Skip to content

Instantly share code, notes, and snippets.

@iuliaL
Last active November 28, 2019 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iuliaL/70edcb020dd685639eba87fcf5ef0c4b to your computer and use it in GitHub Desktop.
Save iuliaL/70edcb020dd685639eba87fcf5ef0c4b to your computer and use it in GitHub Desktop.
Palindrome
transformer word =
String.toLower word
|> String.split " "
|> String.join ""
|> String.filter (\char -> char /= ',')
palindrome w = transformer w == (String.reverse <| transformer w)
isPalindrome = if palindrome "As I pee sir, I see Pisa " == True then "PALINDROME" else "NOT PALINDROME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment