Last updated 1 year ago
Was this helpful?
Built-in
Non-recursive
Recursive
say "noon".is_palindrome # true
func palindrome(s) { s == s.reverse }
func palindrome(s) { if (s.len <= 1) { true } elsif (s.firstĀ != s.last) { false } else { __FUNC__(s.first(-1).last(-1)) } }