I can't get through assign. 3 in the recursive manner. Any hints?
can u tell the question or send link to it?
There are assignments in: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/ No 3 is called 'matching strings...' There is a request to prepare a python code to find the string inside the longer string in a recursive manner. I did the iterative one but make up the other one. Is there any hint?
i wouldn't tell the solution. but a hint decide a base case(i.e where finally 'find' function returns -1) put base case in if statement and in else statement call that function again but with string truncated from the part where it has already counted. Think again How many arguments do u need to pass?
Thanks to your hint I managed to find the answer! Thanks!
Join our real-time social learning platform and learn together with your friends!