K11
Valid Palindrome
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) -> boolInput & 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 charactersExample Execution Walkthrough
metin = "A man, a plan, a canal: Panama"
after cleaning: "amanaplanacanalpanama" -> TrueExample Test Scenarios (4)
Example 1: Panama
Input:
["A man, a plan, a canal: Panama"]Expected Output:
trueExample 2: Palindrom Değil
Input:
["race a car"]Expected Output:
falseExample 3: Boşluk
Input:
[" "]Expected Output:
trueRakam Alfanümerik: 0P
Input:
["0P"]Expected Output:
false