Palindrome string doubt

#include
#include
using namespace std;
bool isp(char *a)
{
int i=0;
int j=strlen(a)-1;
if(strlen(a)==0 || strlen(a)==1)
{
return true;
}
while(i<j)
{
if(a[i]==a[j])
{
i++;
jā€“;
}
else
{
return false;
}
}
return true;
}
int main() {
int n;
bool r;
cin>>n;
char a[n];
cin>>a;
r = isp(a);
//cout<<r;
if(r==true)
{
cout<<ā€œtrueā€;
}
else{
cout<<ā€œfalseā€;
}
return 0;
}

this is my codeā€¦ I am not able to pass all the test cases, can you please guide me?

share code in cb ide please

I have shared it please check

share the ide link hereā€¦