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.

Here is the code.

On running it on different ide, some are showing segmentation fault or SIGTSTP error. Can anyone please tell me what is the error ?

Segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access(eg: reading array elements over its limit )
Look at the constraints on inputs and then typecast the variables according to contraints.

//