As reported: ServiceNow interview, round 1 (1 hour), Jul 2025: introductions and projects; coding — remove duplicates from a sorted array, with a follow-up allowing two copies, then a palindrome check — then JavaScript and CSS tasks.
A phrase is a palindrome if, after lowercasing all letters and removing every non-alphanumeric character, it reads the same forward and backward. Given s, return whether it is a palindrome.
This is LeetCode 125 — Valid Palindrome.
Example
"A man, a plan, a canal: Panama" -> true
"race a car" -> false
" " -> true
Constraints: 1 ≤ s.length ≤ 2 · 10^5; printable ASCII.
Code runner format: one line with s as a JSON string. Implement isPalindrome(s); the harness prints true or false.