Sanket and String Editorial solution

The editorial seems to be wrong as it didn’t pass any test case. Also please add more explanation.

Hey Vikas, the code provided in the editorial is working fine and it’s passing all the test cases.