c++


  • 0
    L

    ...
    class Solution {
    public:
    bool isPalindrome(int x) {
    string s;
    stringstream ss;
    ss<<x;
    s=ss.str();
    for(int i=0,j=s.size()-1;i!=s.size()/2;i++,j--){
    if(s[i]!=s[j])
    return false;
    }
    return true;

    }
    

    };
    ...


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.