In this coding exercise we’ll walk through how to properly create a palindrome method in Ruby, including a discussion on working with case insensitive comparisons.
Summary
Create a method that checks to see if a word is a palindrome or not.
Exercise File
Exercise Description
Given a string such as:
"tacocat"
Check to see if the word is a palindrome. A palindrome is a word that is spelled out the same way if you reverse the letters. Also, ensure that the palindrome method is case insensitive.
Example Input/Output
"tacocat" # true "Tacocat" # true "baseball" # false
Real World Usage
Creating a palindrome method is a common coding interview question. In this exercise, we’ll also cover how to implement case insensitive equality checks. This process is utilized regularly when building out application search engines.
Solution
Can be found on the solutions branch on github.