Memory issues with Find Strings Problem on InterviewStreet
To successfully pass all test cases you need to implement something more sophisticated like suffix tree. That will allow you to solve this task in O(n) time using O(n) space.