leetcode 9. 回文数

https://leetcode-cn.com/problems/palindrome-number/

class Solution {
    public boolean isPalindrome(int x) {
 if (x < 0) {
            return false;
        }
        if (x == 0) {
            return true;
        }
        int n = (int) Math.log10(x) + 1;
        int[] cArray = new int[n];
        for (int i = 0; i < n; i++) {
            cArray[i] = x%10;
            x/=10;
        }
        int i=0,j=n-1;
        while (i

 

你可能感兴趣的:(算法研究)