void solve(){
int n;cin>>n;
string s;cin>>s;
bool dp[n][n]={true};
for(int sz=2;sz<=n;sz++){
for(int i=0;i+sz-1<n;i++){
int start=i;int end=i+sz-1;
if(sz==2)
dp[start][end]= s[start]==s[end];
else
dp[start][end]= s[start]==s[end] && dp[start+1][end-1];
}
}
int q;cin>>q;
while(q–){
int l;int r;
cin>>l>>r;
l–;r–;
if(dp[l][r])
cout<<“YES\n”;
else
cout<<“NO\n”;
}
}
Why the code is showing error