Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string.h>
- #include<string>
- using namespace std;
- bool Check(string str,int s,int length)
- {
- if(length < s) return true;
- if(str[s] == str[length-1]) return Check(str,s+1,length-1);
- return false;
- }
- int main() {
- //code
- int t;
- cin>>t;
- while(t--)
- {
- int dodai;
- cin>>dodai;
- string str;
- cin>>str;
- Check(str,0,dodai) ? cout<<"Yes\n": cout<<"No\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment