class Solution {
public boolean isPalindrome(int x) {
String s = Integer.toString(x);
char[] c = s.toCharArray();
for(int i = 0;i < c.length / 2;i++){
if(c[i] != c[c.length - i - 1]){
return false;
}
}
return true;
}
}
LeetCode 9. 回文数
于 2022-04-29 18:05:53 首次发布
359

被折叠的 条评论
为什么被折叠?



