#C12973. Palindrome Checker
Palindrome Checker
Palindrome Checker
The goal of this problem is to determine whether a given string (ignoring non-alphanumeric characters and case differences) is a palindrome. A string is a palindrome if it reads the same backward as forward after filtering out non-alphanumeric characters and converting all letters to lowercase.
Special conditions:
- If the input string is exactly
None
, then outputError: Null input not allowed
.
Note that the validations for non-string types are not applicable since the input is always given as a string via STDIN.
Examples:
- Input:
racecar
→ Output:Palindrome
- Input:
A man, a plan, a canal: Panama
→ Output:Palindrome
- Input:
Hello, World
→ Output:Not a Palindrome
- Input:
None
→ Output:Error: Null input not allowed
inputFormat
The input consists of a single line containing a string. This string may include spaces, punctuation, and mixed cases. If the input string is exactly None
, it should be treated as a null input.
outputFormat
Output a single line with one of the following responses:
Palindrome
if the input string (after filtering) is a palindrome.Not a Palindrome
if it is not a palindrome.Error: Null input not allowed
if the input is exactlyNone
.
racecar
Palindrome