Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8fa467e

Browse files
committedNov 30, 2022
add solution in Python for 0009_palindrome_number.py
1 parent b742851 commit 8fa467e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def isPalindrome(self, x: int) -> bool:
2+
string = str(x)
3+
i = 0
4+
j = len(string) - 1
5+
6+
while (i < j):
7+
if (string[i] != string[j]):
8+
return False
9+
i += 1
10+
j -= 1
11+
12+
return True

0 commit comments

Comments
 (0)
Please sign in to comment.