I think there a prob in code

while checking characters are same
prateek bhaiya has done (s1[i]==s2[i])
and it should be s1[i] and s2[j]

Yes right. You can make the change in your code.

pls send bottum up approach code

as i didn’t understand it properly


Please refer to this link.