Skip to content

Instantly share code, notes, and snippets.

@leeavital
Created May 6, 2013 17:48
Show Gist options
  • Save leeavital/5526756 to your computer and use it in GitHub Desktop.
Save leeavital/5526756 to your computer and use it in GitHub Desktop.
The Most Important Problem in the History of Cutlery Science
from itertools import permutations, combinations
chopsticks = ["ch", "op", "st", "icks"]
spoon = ["sp", "oon"]
fork = ["f", "ork"]
knife = ["k", "ni", "fe"]
"chopsticks"
"spoon"
"fork"
"knife"
for c in chopsticks:
for s in spoon:
for f in fork:
for k in knife:
for x in combinations( (c, s, k, f), 4 ): print "".join(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment