```
char* longestPalindrome(char* s) {
static char *a;
int t[1000][1000]={0};
int n=0;
int begin=0;
int max=1;
while(s[n]!='\0')
{
n++;
}
for(int i=0;i<n;i++)
{
t[i][i]=1;
}
for(int i=0;i<n-1;i++)
{
if(s[i]==s[i+1])
{
t[i][i+1]=1;
begin=i;
max=2;
}
}
for(int len=3;len<=n;len++)
{
for(int i=0;i<n-len+1;i++)
{
int j=i+len-1;
if(s[i]==s[j]&&t[i+1][j-1]==1)
{
t[i][j]=1;
begin=i;
max=len;
}
}
}
a=(char *)malloc(max*sizeof(char));
for(int i=0;i<max;i++)
{
a[i]=s[i+begin];
}
return a;
```

}

Input: "dddddddd"

Output:"dddddddd""

Expected:"dddddddd"

why there is one more " in my output