Skip to content

Instantly share code, notes, and snippets.

@lost-theory
Last active January 3, 2016 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lost-theory/8412918 to your computer and use it in GitHub Desktop.
Save lost-theory/8412918 to your computer and use it in GitHub Desktop.
$ #spoiler alert!
$ grep -rn CLUE .
$ for v in `grep Make: vehicles | awk '{print $2}' | sort | uniq`; do grep -rn $v interviews; done;
$ python
>>> membership_suspects = reduce(set.intersection, map(set, [[x.strip() for x in open("memberships/%s" % y).readlines()] for y in ["AAA", "Delta_SkyMiles", "Museum_of_Bash_History"]]))
>>> people = [x.strip().split('\t') for x in open("people").readlines() if "\t" in x]
>>> male_suspects = [x[0] for x in people if x[1] == "M"]
>>> membership_suspects.intersection(male_suspects)
...
>>> len(_)
42
>>> license_plate_suspects = set(x.split("Owner: ")[1].split('\n')[0].strip() for x in open("vehicles").read().split("License Plate") if "L337" in x and "Blue" in x and "Honda" in x)
>>> membership_suspects.intersection(male_suspects).intersection(license_plate_suspects)
...
>>> len(_)
1
>>> #i think we've got our man...
>>> open("streets/Dunstable_Road").readlines()[283]
...
>>> open("interviews/interview-9620713").read()
...
>>> #yep, book em danno!
$ less ../solution
$ #run the command
$ #YAAAAY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment