#C3395. Anagram Checker
Anagram Checker
Anagram Checker
Given two strings, determine whether they are anagrams of each other. Two strings are anagrams if they contain the same characters in any order, ignoring case, spaces, and any non-alphanumeric characters.
If either string becomes empty after removing non-alphanumeric characters, the result should be False
.
For example, "Astronomer" and "Moon starer!" are anagrams because, after filtering and lowercasing, they both yield the same set of characters.
Your task is to write a program that reads two lines from stdin (each representing one string) and prints True if they are anagrams according to the rules above, or False otherwise.
inputFormat
The input consists of two lines:
- The first line contains the first string.
- The second line contains the second string.
outputFormat
Output a single line with either True
or False
indicating whether the two strings are anagrams of each other, based on the given criteria.
listen
silent
True