Min Palindromic Swaps!

Please help me with this problem , Logic seems to be correct . Its failing for two /four hidden test case .

thanks in advance !


I think so, you are not checking case when it is possible that i+1 is equal to j or vise-versa at that point you can’t because you are comparing the same position value and swapping.
I hope I made it clear.I did this change in your code it run.You may check.

1 Like

Thanks for pointing it out. :slight_smile: