Palindrome, Roughly
Ignoring everything except letters and digits, and ignoring case, is the line a palindrome?
Input: one line with printable text (letters, digits, spaces, punctuation).
Output: YES or NO.
Constraints:
- 1 ≤ length ≤ 104
Sample Tests
Input 1
A man, a plan, a canal: Panama
Output 1
YES
Input 2
race a car
Output 2
NO
Discussion (opens after you solve — no spoilers before)
No comments yet.