Created
March 29, 2024 15:01
-
-
Save codertcet111/e13735547b2e9066f07f0ef229946e94 to your computer and use it in GitHub Desktop.
Leetcode 9: palindrom number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leetcode 9: palindrom number | |
# @param {Integer} x | |
# @return {Boolean} | |
def is_palindrome(x) | |
str = x.to_s | |
str == str.reverse | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment