First puzzle: You might think you have to do an exhaustive search of all possible seeds for the random number generator, but it turns out they've made it easy for you. The initial seed is at one extreme end of the possible range....
Second puzzle: Just create a stack, and walk through the string pushing and popping as you go.
By the way, I'm sure there's a mistake in there. I got the answer x (and I checked it by hand) but it only accepts the answer x - 1.
Third puzzle: My approach used dynamic programming algorithms. If you're unfamiliar with this technique, you'll probably want to find a different way to solve it.
First, I used dynamic programming to find all routes of the form (north|east)+ (i.e. all routes in which the rabbit only goes north and east). That didn't work, but it was clear that the rabbit could only double back on itself a limited number of times, so I extended my code to find all routes of the form (north|east)+((south|west)+(north|east)+)
First puzzle: You might think you have to do an exhaustive search of all possible seeds for the random number generator, but it turns out they've made it easy for you. The initial seed is at one extreme end of the possible range....
Second puzzle: Just create a stack, and walk through the string pushing and popping as you go.
By the way, I'm sure there's a mistake in there. I got the answer x (and I checked it by hand) but it only accepts the answer x - 1.
Third puzzle: My approach used dynamic programming algorithms. If you're unfamiliar with this technique, you'll probably want to find a different way to solve it.
First, I used dynamic programming to find all routes of the form (north|east)+ (i.e. all routes in which the rabbit only goes north and east). That didn't work, but it was clear that the rabbit could only double back on itself a limited number of times, so I extended my code to find all routes of the form (north|east)+((south|west)+(north|east)+)