K11

Valid Palindrome

Junior Level Candidate
Target Time: 15 - 20 Minutes
Type: BOOLEAN

Problem Statement & Objective

A text processing engine validates candidate strings for symmetry. A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Return True if the input is a palindrome, False otherwise.

Function Signature (Python)

is_palindrome(s: str) -> bool

Input & Output Contract

Output Rule:Boolean True or False. Empty string returns True.

System Constraints

0 <= metin.length <= 2 * 10^5
metin consists only of printable ASCII characters

Example Execution Walkthrough

metin = "A man, a plan, a canal: Panama"
after cleaning: "amanaplanacanalpanama" -> True

Example Test Scenarios (4)

Example 1: Panama
Input:["A man, a plan, a canal: Panama"]
Expected Output:true
Example 2: Palindrom Değil
Input:["race a car"]
Expected Output:false
Example 3: Boşluk
Input:[" "]
Expected Output:true
Rakam Alfanümerik: 0P
Input:["0P"]
Expected Output:false
Loading Python Editor...
Input Parameters
[
  "A man, a plan, a canal: Panama"
]
Expected Output
true