Testcase 120030221 should be added.


  • 0
    X

    I test the code I found in other answers. 120030221 should not be Palindrom, but the code return true. And it passed the OJ. So.....

    bool isPalindrome(int x) {
        if(x<0)
            return false;
        while(x)
        {
            if(x/int(pow(10,int(log10(x))))!=x%10)
                return false;
            if(int(log10(x)))
                x/=pow(10,int(log10(x))-int(log10(x-(x/int(pow(10,int(log10(x)))))*pow(10,int(log10(x))))));
            x-=(x/int(pow(10,int(log10(x)))))*int(pow(10,int(log10(x))));
        }
        return true;
    }

  • 0

    Thanks for reporting, I've added this test case.


Log in to reply
 

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