首页 > 代码库 > [LeetCode] Palindrome Number

[LeetCode] Palindrome Number

public class Solution {    public boolean isPalindrome(int x) {                if (x<0) return false;                int highNum = 1;        int lowNum  = 1;                while (x/highNum >= 10 ) highNum *= 10;        while (highNum > lowNum) {            if ((x/highNum)%10 != (x/lowNum)%10) return false;            highNum /= 10;            lowNum *= 10;        }                return true;            }}

 

[LeetCode] Palindrome Number