Skip to content

Commit 6a9ab8f

Browse files
committed
11
1 parent 8eac1c4 commit 6a9ab8f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Leetcode09.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
回文数:
3+
回文数:从正序和倒序读都一样的整数
4+
5+
思路:
6+
1. 利用python切片一行搞定(内存消耗大)
7+
8+
2.位运算?
9+
10+
....
11+
12+
13+
"""
14+
15+
class Solution:
16+
def isPalindrome1(self, x: int) -> bool:
17+
return str(x) == str(x)[::-1]
18+
19+
20+
21+
def isPalindrome2(self, x: int) -> bool:
22+
23+
24+

0 commit comments

Comments
 (0)