pheinrich / fbinvite Goto Github PK
View Code? Open in Web Editor NEWSolution to Facebook-Seattle's 8/25/10 party invite challenge.
License: GNU General Public License v2.0
Solution to Facebook-Seattle's 8/25/10 party invite challenge.
License: GNU General Public License v2.0
Facebook Invite Challenge Copyright (c) 2010 Peter Heinrich When Facebook opened their Seattle office, they wanted to celebrate with an open-house (recruiting) party in their new space. Since space was limited, however, they chose to limit invitations to those who could solve a little puzzle they devised. http://www.facebook.com/note.php?note_id=146727365346299 Actually, solutions to two puzzles were required, since the post above didn't explicitly reveal the URL where details of the challenge could be found. In- stead, a partial URL was listed, with clues describing the last portion: http://www.facebook.com/seattle/[insert-word-here] The first occurrence of 'e' comes before 1 occurrence of 's'. The first occurrence of 'i' comes before 1 occurrence of 'n'. The first occurrence of 'i' comes before 1 occurrence of 'i'. The first occurrence of 'n' comes before 2 occurrences of 'e'. The first occurrence of 'e' comes before 1 occurrence of 'e'. The first occurrence of 'i' comes before 1 occurrence of 'v'. The first occurrence of 'n' comes before 1 occurrence of 'i'. The first occurrence of 'n' comes before 1 occurrence of 'v'. The first occurrence of 'i' comes before 1 occurrence of 's'. The first occurrence of 't' comes before 1 occurrence of 's'. The first occurrence of 'v' comes before 1 occurrence of 's'. The first occurrence of 'v' comes before 2 occurrences of 'e'. The first occurrence of 't' comes before 2 occurrences of 'e'. The first occurrence of 'i' comes before 2 occurrences of 'e'. The first occurrence of 'v' comes before 1 occurrence of 't'. The first occurrence of 'n' comes before 1 occurrence of 't'. The first occurrence of 'v' comes before 1 occurrence of 'i'. The first occurrence of 'i' comes before 1 occurrence of 't'. The first occurrence of 'n' comes before 1 occurrence of 's'. I'm not much for word games or anagrams (actually, I hate them), so I wasn't interested in puzzling through this--maybe it was straightforward, I don't know. Instead, I took the easy way: peter@Ancaeus ~ $ aspell dump master > dict.txt peter@Ancaeus ~ $ egrep "[^s]*e.*s" dict.txt | egrep "[^n]*i.*n" | egrep "^([^i]*i[^i]*){2}" | egrep "[^n]*n[^e]*e[^e]*e" | egrep "^([^e]*e[^e]*){2}$" | egrep "[^v]*i.*v" | egrep "[^n]*n.*i" | egrep "[^n]*n.*v" | egrep "[^i]*i.*s" | egrep "[^t]*t.*s" | egrep "[^v]*v.*s" | egrep "[^v]*v[^e]*e[^e]*e" | egrep "[^t]*t[^e]*e[^e]*e" | egrep "[^i]*i[^e]*e[^e]*e" | egrep "[^v]*v.*t" | egrep "[^n]*n.*t" | egrep "[^v]*v.*i" | egrep "[^i]*i.*t" | egrep "[^n]*n.*s" invitees vindictiveness vindictiveness's Not pretty, but straightforward, since the regexes can basically be copied directly from the individual clues. Only three words satisfied all the con- straints, and it seemed pretty clear which was intended. I subsequently refined the expression, since the clues make it clear that: 1. only the letters e, i, n, s, t, and v appear in the word 2. the letter s appears exactly once, at the end 3. the letters e and i appear exactly twice peter@Ancaeus ~ $ aspell dump master | egrep "^[eintv]{7,}s$" | egrep "n.*e{2}" | egrep "v.*e{2}" invitees With the URL cracked, the real programming challenge was revealed: use the Facebook Graph API to determine which of your friends shared the most likes and interests with you. I think most people would agree that this was almost too easy, since (as I discovered) Facebook's Graph API makes this kind of thing a snap.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.