Facing problems in string

what’s wrong with the code please help it’s isn’t satisfying all the test cases
link to the code

Pranav, plz work more on your logic, try to use some different approach for this problem.