How to remove runtime SIGTSTP error?

I wrote the following programme which will store the occurrence of every letter of a string in an array and upon seeing a letter repeated , it will take the data from previous element of array.

The above link has the code. On running the code it shows “Runtime exceeded”. Can anyone help me?