Skip to content

Commit 6295f63

Browse files
authored
Create Solution.py
1 parent a1a7740 commit 6295f63

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution:
2+
def isPalindrome(self, num):
3+
"""
4+
:type num: int
5+
:rtype: bool
6+
"""
7+
if(num<0): return False
8+
9+
temp = num
10+
rev = 0
11+
while(temp>0):
12+
rev = (rev*10)+(temp%10)
13+
temp//=10
14+
15+
return (rev == num)

0 commit comments

Comments
 (0)