Pls give the recursive solution for this problem as the given solution is not recursive and pks help me to debug this code pls.It's failing in some testcases

//#include<bits/stdc++.h>
#include
#include
using namespace std;

bool palindrome(char a[],int strt,int end)
{
bool p;
if(strt==end || n==0)
{
p=true;
}

else if(a[strt]==a[end])
	{
		
		p=palindrome(a,strt+1,end-1);
	}
	else
	{
		p=false;
	}
return p;

}

int main()
{
int n;
cin>>n;
cin.get();
//char *a=new char[n];
char a[n];
cin>>a;
int strt=0,end=n-1;

bool p=palindrome(a,strt,end);
if(p==false)
cout<<"false";
else
cout<<"true";

}

ok wait , let me check

a)

u cannot read it like this.
because all numbers are in separate line.
use loop to read n numbers.
b)

here it should be
if(start>=end){

}

it is still not getting passed pls help me to debug it

don’t take input as character array (string) instead take an integer array ,
the reason is
for test cases like
4
12
13
13
12

you will make a character array of size 4
and take,say, 12 as a input for a character which is not valid as 12 consists of two characters β€˜1’ and β€˜2’ so take integer array

corrected code :- https://ide.codingblocks.com/s/282677