public static boolean isPalindrome(int x) {//passed but not accepted
        //because this solution is not in-place
        String str = Integer.toString(x);
        char[] strarr = str.toCharArray();
        System.out.println(strarr[0]);
        int len = strarr.length;
        for (int j = 0; j < len; ++j) {
            System.out.println(strarr[j]);
        }
        for (int i = 0; i < len/2; ++i) {
            if (strarr[i] != strarr[len - i - 1]) {
                System.out.println("Not palin");
                return false;
            }
        }
        System.out.println("palin");
        return true;
    }