Skip to content

Commit

Permalink
Merge pull request #35 from artemis-i-guess/main
Browse files Browse the repository at this point in the history
Q9_Palindrome_Number in LeetCode in .py
  • Loading branch information
DugarRishab authored Oct 3, 2022
2 parents 1d210bd + 96ea9be commit b037ba1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Solution(object):
def isPalindrome(self, x):
#as we have left parameters empty below, End index defaults to the beginning of the
# #string and Beginning index defaults to the end of the string, and we move -1 step from
# #the back to the front and compare it with x

return False if x < 0 else x == int(str(x)[::-1])

0 comments on commit b037ba1

Please sign in to comment.