SPOILER/CHEAT: SQL solution

Tyler Strickland tyler at tylers.org
Fri Mar 10 16:56:03 MST 2006


Python solution (quick and dirty version):

=============================================

import sys
words = [line.strip() for line in open(sys.argv[1])]
[ sys.stdout.write(line.strip() + ': ' + str(words.count(line.strip()))\
  + '\n') for line in open('/usr/share/dict/american-english') if 
line.strip() != '' and\
  words.count(line.strip()) > 0 ]




More information about the PLUG mailing list