Elixir Palindrome Detector

elixirgolf bio photo By elixirgolf Comment

Instructions

A palindrome is a sequence of characters which can be read forwards or backwards.
For example a good word palindrome might be:

level

or for a sentence palindrome, you could have:

was it a car or a cat i saw

Your job is to write Elixir code that takes a string from the standard input and outputs a true / false value indicating whether that string is a palindrome or not.

Code will be run from iex, when your code is executed it will prompt for user input and on return will output a true or false value.

iex> --enter your code here--
level
true

Rules

  • Punctuation and whitespace is allowed in the input string of characters, however your program should ignore it, and should not affect whether the string is a palindrome or not.
  • Numbers are valid palindrome characters.
  • The case of the input string should not affect palindrome determination. Therefore “Taco cat” is purrfectly valid.
  • There is no limit on the length of the input string.
  • Only use the ASCII character set.

Submit your solution

Please submit your solution as a comment on the Github issue below, along with your Twitter handle (we will use this to link back to you if your solution is successful).

Solutions

Winner

--- your name here ---

Honourable mentions


Resources

comments powered by Disqus