Toph Problem Is Palindrome Solution in C++

Problem Link
Toph Problem Is Palindrome Solution in C++
Solution:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,rs;
    cin>>s;
    rs=s;
    reverse(rs.begin(),rs.end());
    if(rs==s)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;

}

No comments

Theme images by enjoynz. Powered by Blogger.