Why am I getting WA on problem:http://www.spoj.com/status/STRNGSLV/
Here is my code:http://ideone.com/HZU1KS
If I'm understanding the problem statement correctly, the task would be to find the longest sub-string he can tolerate, and yet it says WA. Or is the task to find the number of substrings he can tolerate starting from char 1 till length - 1, I tried both and it still failed me -_-. Can anyone explain problem statement better for me?