A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 one year ago
600SC(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
anonymous
 one year ago
600SC(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

This Question is Open

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0I 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)]

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0*the correct version should be giving me: [(0,6), (3,18), (12,16)]

rsmith6559
 one year ago
Best ResponseYou've already chosen the best response.0First, 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.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.