Help needed to detect error in the code - Please respond ASAP

Sir I am trying to solve a challenge from CodeChef - Feb Long Challenge - Team Name. I have written a code for it, which runs perfectly on the custom inputs. But it is partially accepted because, on in-built test cases, the code shows this error: ‘SIGCONT’.

I don’t need the solution code. But I want to know what is wrong with my code. I am sending you my code. Please let me know the error only.

Link to Question:
https://www.codechef.com/FEB21C/problems/TEAMNAME

Link to my solution:

I don’t exactly know why your code throws this error but you can take a look at this https://discuss.codechef.com/t/sigcont-error/60638/3

But even then your solution is O(n^2), which will not pass the testcases as it is too slow.

I can’t give you the solution as it is a running contest, but I can give you a hint.
Try to make a map of substrings ranging from 1st character to last character.
Like ‘ell’ for hell and mark for every character which has that substring.
Now try to map each character to every other character by taking an array of cnt[26][26] and perform inclusion and exclusion.

This is the only hint I can give as of now.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.