Rhy one test case is not right?

Hi @kailash_01
See in your code you are just checking if ith and jth element index are same and if they are same then you are returning true. But in this approach test cases like :
4
1 2 3 1
gives true as output because when you compare arr[0] and arr[3] then you return true but this is not a palindrome.

So as to over come this you need to check arr[i] and arr[j] and if they are not equal then return false and after the while loop return true.

Here is your corrected code :

if your doubt is clear then mark it as resolved.