SANKET AND STRINGS sub prob

i got wrong answer while submitting the code,My Code: