December 27 - Creating a Palindrome Method in Ruby
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.
Guide Tasks
- Read Tutorial
- Watch Guide Video
- Complete the Exercise
Video locked
This video is viewable to users with a Bottega Bootcamp license
Already a Bottega Student? Sign In
Summary
Create a method that checks to see if a word is a palindrome or not.
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.