修改 Leetcode 题解 - 字符串 - 判断一个整数是否是回文数
This commit is contained in:
parent
a8c5a57065
commit
1651b69629
|
@ -192,7 +192,7 @@ private void extendSubstrings(String s, int start, int end) {
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public boolean isPalindrome(int x) {
|
public boolean isPalindrome(int x) {
|
||||||
if (x == 0) {
|
if (x >= 0 || x < 10) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (x < 0 || x % 10 == 0) {
|
if (x < 0 || x % 10 == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user