Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 9 Online
OpenStudy (anonymous):

I'm just trying to figure this out, so apologize for any mistakes. I have two questions: first, is there a way to search previous questions to see if my questions have already been answered? and second, my head swims when I try to think about pset 3, problem 3. Apparently I am not so good with the math. Can anyone give me a hint? Thanks so much!

OpenStudy (preetha):

You could try google. Type in some key terms in the problem set. All OpenStudy questions are archived and searchable by google.

OpenStudy (anonymous):

hint for pset 3 problem 3: if you are trying to find constrained match pairs for 'abcd', you need to divide this into: 1. '' and 'bcd' (with 'a' gone) 2. 'a' and 'cd' (with 'b' gone) 3. 'ab' and 'd' (with 'c' gone) 4. 'abc' and '' (with 'd' gone) Example, you are searching within 'ababfdbcd' and let's take case 3 ('ab' and 'd' (with 'c' gone)). You have to do this for all cases though firstMatch: for 'ab', using subStringMatchExact('ababfdbcd', 'ab') will give you (0, 2) secondMatch: for 'd', using subStringMatchExact('ababfdbcd', 'd') will give you (5, 8) Clearly, the only valid output for this case would be 'abfd' which is in index 2. Hence, to get which ones are valid, the index of 'd' should be index of 'ab' + len('ab') + 1. 1 is for the extra 'wildcard' letter in the middle. Now, I won't post the code in here. You should be the one to figure it out. :) I hope this helps and if you have more questions, don't hesitate to ask because I'm willing to help. :)

OpenStudy (anonymous):

Based on what Preetha has said, this might interest you: http://openstudy.com/users/chribonn#/updates/4f7bef3ae4b0587805a150d5

OpenStudy (anonymous):

I think I've figured it out, thank you for the hints and search tips. kcpaas, the hints made the problem much clearer. Next I need to decipher the "template" that goes with it...sounds like a project for tomorrow.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!