一个多月前就看了下,这题label为Easy,跟 7. Reverse Integer 有关系,自己做7. Reverse Intege时就简单把整数转为字符串来解决,而这题提示Coud you solve it without converting the integer to a string,自己对c语言为例的过程化编程还是欠差,google 关键字 Palindrome Number,出来
- C Program to Check Whether a Number is Palindrome or Not
- Palindrome number in C
- To check a number is palindrome or not without using any extra space
- Palindrome Program in Java
最后参照 C Program to Check Whether a Number is Palindrome or Not 的写了java代码,在Eclipse里跑了下,结果不对,又看人家的代码,看来自己还是不理解这个求逆序数的步骤
1 | class Solution { |
Submission Detail
- 11508 / 11508 test cases passed.
- Your runtime beats 58.36 % of java submissions.