My code seems to be correct and also using recurison still test cases are not passing

#include
using namespace std;
bool isPalindrome(int arr[],int n){
if(n==0||n==1){
return true;
}
if(arr[0]==arr[n-1]){
bool res=isPalindrome(arr+1,n-2);
}
else{
return false;
}
return true;
}
int main() {
int n;
int arr[100];
cin >> n;
for(int i=0;i<n;i++){
cin >> arr[i];
}
cout << isPalindrome(arr,n);
return 0;
}

hello @kkunalguptaaa

here it should be
return isPlaindrome(arr+1,n-1)

declare array of size n .
like this->
cin>>n;
int arr[n];

also
u need to print true and false but ur code will print 0 and 1

the problem statement is not clear it mentions that function returns bool and print it, i wasted 2hrs of mine in this…pls make problem statement clear.

always check output format of the questions for better clarity of output u need to print