Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Latest commit

 

History

History
37 lines (30 loc) · 1.28 KB

Palindrome.md

File metadata and controls

37 lines (30 loc) · 1.28 KB

Palindrome

A palindrome is a word, phrase, number or sequence of words that reads the same backward as forward. Punctuation and spaces between the words or lettering is allowed.

Steps

  1. Clean the string by removing all punctuation and whitespace and converting all letters to lowercase.
  2. Reverse the clean string.
  3. If the clean string is the same as the reversed string then we have a palindrome.

Example

Single Word Palindromes

  • Civic
  • Level
  • Madam
  • Radar

Multiple Word Palindromes

  • Don't nod.
  • I did, did I?
  • My gym
  • A man, a plan, a canal - Panama

Implementation

Video URL

A coursera video explaining the palindrome Algorithm

Others

Wikipedia