i got in trouble in the wordgame question, more specifically in the 'get_best_word_faster' part.how can i get all possible subsets of the letters of a hand? for now,what i can do is using quite a lot 'for' sentences to get them.there must be a better way.could anyone help me?
I used the itertools.combination() method of the itertools library to do that. http://docs.python.org/library/itertools.html#itertools.combinations I know some people here don't agree with me because they think that using a third-party library to do it is kindda cheating. My point of view is that it's not the point of this assignment. Choose your side :)
hmmm, you must be looking at newer course material, the Fall 2008 handout doesn't have that
yeah, I don't see that comment either. I found this problem extremely challenging, but it can be done without itertools. Here's a good example: http://codepad.org/SBwCIqFS (not my solution).
here's a combination/multiset generator that makes use of string formatting http://dpaste.com/708751/
Join our real-time social learning platform and learn together with your friends!