Skip to main content

Practice · 1 of 5

Palindrome Check

CHALLENGE
Difficulty: beginner+25 XP

**Description:** Given a string s (letters and digits), determine whether it reads the same forwards and backwards. Case matters: 'a' and 'A' are different characters. **Input:** One line: s (1 <= |s| <= 10^6). **Output:** YES if s is a palindrome, otherwise NO. **Example:** racecar -> YES; abab -> NO.

Back to lesson: Practice: String Problem Set