Skip to content

Latest commit

 

History

History
7 lines (6 loc) · 430 Bytes

File metadata and controls

7 lines (6 loc) · 430 Bytes

Is it a Palindrome?

A word (or sentence) is a palindrome when reading it from right to left is the same as from left to right. For example: level is a palindrome.

The code uses recursion in order to iteratively compare the first and last element of the string, gradually reducing the string until the middle of it. Recursion is used when you do not know in advance how many iterations you need in order to get a solution.