This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package class030;
// 测试链接:https://leetcode.com/problems/palindrome-number
public class Code01_IsPalindrome {
// n<0 不是回文数
public static boolean isPalindrome(int n) {
if (n < 0) {
return false;
}
int help = 1;
while (n / help >= 10) {
help *= 10;
while (n != 0) {
if (n / help != n % 10) {
n = (n % help) / 10;
help /= 100;
return true;