Again this code is giving me wrong output in test case 2 and 3? i cant understand why

I have edited your code… Try to submit now…