Palindrome, ignoring punctuation
A free easy coding practice problem. Solve it in JavaScript, TypeScript or Python and check your solution against fresh hidden tests — edge cases and random inputs — as often as you like.
- Difficulty
- Easy
- Type
- Function
- Languages
- JavaScript, TypeScript or Python
Problem
Return true if s reads the same forwards and backwards after lower-casing it and keeping only letters and digits (a–z, 0–9).
Function signature
// JavaScript
function isCleanPalindrome(s)
// TypeScript
function isCleanPalindrome(s: any): any
// Python
def is_clean_palindrome(s):Examples
isCleanPalindrome("A man, a plan, a canal: Panama")→trueisCleanPalindrome("race a car")→falseisCleanPalindrome(" ")→true
How checking works
Run your code against the examples above, then submit a check: it runs on the server against hidden tests built fresh each time, including edge cases and random inputs. Practice is untimed and never affects a verified score; when you are ready, take a graded coding challenge to earn a badge.