6 kyu

Palindrome for your Dome

960 of 3,429driedyam

Description:

A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction. Famous examples include "Amore, Roma", "A man, a plan, a canal: Panama" and "No 'x' in 'Nixon'". - wikipedia

Our goal is to determine whether or not a given string is a valid palindrome or not.

Like the above examples, here are a few test cases which are also populated:

"Amore, Roma" => valid
"A man, a plan, a canal: Panama" => valid
"No 'x' in 'Nixon'" => valid
"Abba Zabba, you're my only friend" => invalid

You can see that they are case insensitive and disregards non alphanumeric characters. In addition to a few predefined tests, your function will also be tested against a random string generator 50 times which are guaranteed to produce valid palindromes.

Notes:

The empty string "" can be read forward or backward the same, it's a palindrome in our case.

Logic
Strings
Algorithms

Stats:

CreatedFeb 19, 2014
PublishedFeb 19, 2014
Warriors Trained5710
Total Skips971
Total Code Submissions17475
Total Times Completed3429
Ruby Completions960
JavaScript Completions2444
Haskell Completions116
Total Stars89
% of votes with a positive feedback rating93% of 317
Total "Very Satisfied" Votes278
Total "Somewhat Satisfied" Votes34
Total "Not Satisfied" Votes5
Ad
Contributors
  • driedyam Avatar
  • jhoffner Avatar
  • bkaes Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • NunoOliveira Avatar
  • hobovsky Avatar
Ad