• anonymous
6-00SC(2011) Problem#4 of Problem set 4. Hi. After two days of wrecking my brain I've come up with a partially correct (mostly incorrect) code. If anyone can describe what i'm doing wrong or can share the correct version, i'd greatly appreciate it. At this point all I want is to see the code work. The code is posted on the comment below
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
  • katieb
I got my questions answered at in under 10 minutes. Go to now for free help!
  • anonymous
I say partially correct because of the following output >>> s = apply_shifts("Do Androids Dream of Electric Sheep?", [(0,6), (3, 18), (12, 16)]) >>> s 'JufYkaolfapxQdrnzmasmRyrpfdvpmEurrb?' >>> shifts = find_best_shifts_rec(wordlist, s, 0) >>> shifts [(0, 6), [(3, 18), [(9, 16), [(6, 0), [(3, 0), None]]]]] the correct version should be giving me: [(0,6),(3,8),(12,16)]
1 Attachment
  • anonymous
*the correct version should be giving me: [(0,6), (3,18), (12,16)]
  • rsmith6559
First, is s correct after apply_shifts()? find_best_shifts is returning a list of tuple and list of tuple and list of tuple and list of tuple and list of tuple and None. So however you're iterating (iterating or recursion) at the top level has issues.

Looking for something else?

Not the answer you are looking for? Search for more explanations.