FunctionRacerProblemsRace

Same Both Ways

BeginnerRecursionPython, JavaScript, TypeScript, Java, C++

Return True if word reads the same from left to right as from right to left, and False otherwise. The empty string and any single character read the same both ways.

For example, "level" gives True and "levels" gives False.

Example 1

word "level"
returns true

Reversed, level is still level.

Example 2

word "levels"
returns false

Reversed, levels becomes slevel, which is different.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Recursion problems