Problem Set 4, Question 4 (Multi-Level Code-breaking) is killing me - Can anyone give me some pointers on how they successfully approached this? My only plan right now is to: 1) Take the text and find the first valid deciphered segment off the front. 2) Take the remainder of the text and repeat this until you've reached the end. What I can't figure out is how I should be using the 'start' argument, which seems to be pretty key to this problem. Thanks very much!
Ok I have a semi-working code now. Disregard this message. But if you do have a solution for PS4 problem 4, I'd love to see it.
I believe solutions are posted with the problem set On your question though, on subsequent permutations, you do not want to apply the shift to the entire string, only to the portion of the string that has not yet been shifted. The plaintext response after a permutation would be the combination of the previously decyphered text and the shifted result of the rest. Whenever working with recursive programming, it's often easiest to think of your end case first, as every other iteration is just another application of that. In this case, the final recursion will result in finding a word or string of words that takes up the entire string from 'start' to end. When that happens, the final result is the combination of that decyphyered string, and the already known good plaintext before it. I hope that helps without giving away too much of the algorithm. Moderators, please feel free to edit/delete if this is giving away too much
Join our real-time social learning platform and learn together with your friends!