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.
Press Submit to check your solution.
Back to lesson: Practice: String Problem Set