125. Valid Palindrome
Input: "A man, a plan, a canal: Panama"
Output: trueInput: "race a car"
Output: false# @param {String} s
# @return {Boolean}
def is_palindrome(s)
s = s.downcase.delete("^/a-z0-9/")
s == s.reverse
endLast updated
Input: "A man, a plan, a canal: Panama"
Output: trueInput: "race a car"
Output: false# @param {String} s
# @return {Boolean}
def is_palindrome(s)
s = s.downcase.delete("^/a-z0-9/")
s == s.reverse
endLast updated