I have a code of Hack The Password.
The online IDE ideone it shows absolutely correct output. My own test cases pass. But in submission it gives runtime error.
Did you test it with a string of the maximum length? The minimum length? Did you try deleting when at the first character? Moving left from the start or moving right from the end? etc etc