I'm on problem set 6 working on pick_best_word_faster. What does it mean by "for each subset S of letters in hand"? Are we supposed to find all possible subsets? I'd like some example code, but I can't seem to find out how to search previous questions in OpenStudy
because the dictionary keys are ordered (sorted) you only need to find all the (ordered/sorted) combinations - NOT permutations. if hand is 5 letters you need to find the combinations of 1, 2, 3, 4, and 5 letters if you search for combination algorithms/code there should be a lot of hits. a search for powerset should yield some results. we can show you our code right off the bat if you want and there are some fairly recent threads on this subject.
Or you could use the standard "combinations" imported from itertools.
:) i was saving that for later, in case six wanted to try to make one. maybe not exactly germaine to the pset, but it is a good exercise. I origianlly started out making one, found itertools and used it, then went back and made one anyway - to see if i could
Join our real-time social learning platform and learn together with your friends!