Palindromes Problem

Palindromes Problem
0

#1

I’m doing the Palindromes challenge in the Algorithms section. My code may be inefficient and inelegant, but it works… except that the system is saying: “palindrome(“1 eye for of 1 eye.”) should return false.”

But once you remove the non-alphabetical characters, “eyeforofeye” is a palindrome. Or am I missing something??

Also, I thought the Algorithms section was to give us practice doing what we learned. I read through the various solutions and explanations for this and an earlier challenge, and I see that unlike the challenges at the end of the Front-End Dev section, which were projects, these are really more lessons. If you don’t check the so-called hints, you miss out on learning new concepts and how to refine your problem solutions.

Really, it would be better if they let people know there are lessons for these exercises.

#2

You should remove non-alphanumeric characters, not just non-alphabetical ones.

#3

Ummmm… non-alphabetical characters include non-alphanumeric characters. “.” is both non-alphabetical and non-alphanumeric. If I only removed non-alphanumeric characters, I’d be left with “1” in the string…

Oh. I just went back and checked the instructions, and they do say to remove non-alphanumeric characters, which would leave the numbers in — and make that string false. Thanks!

#4

The assignment requires that we remove non-alphanumeric characters, namely punctuation, spaces and symbols. Numbers and letters are alphanumeric (the word itself tells us so). Hence 1 cannot be removed from “1 eye for of 1 eye.”