#C53. Anagram Checker

    ID: 48933 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

Given two strings, determine if they are anagrams of each other. Two strings are anagrams if they consist of the same letters in any order after removing all non-alphabetical characters and ignoring case. In other words, if we let \(s_{cleaned}\) be the string obtained by removing all non-alphabetic characters from \(s\) and converting it to lowercase, then two strings \(s_1\) and \(s_2\) are anagrams if and only if:

\(sorted(s_{1,cleaned}) = sorted(s_{2,cleaned})\)

For example, "Listen" and "Silent" are considered anagrams.

inputFormat

The input is read from standard input (stdin) and consists of two lines. The first line contains the first string and the second line contains the second string. The strings may include spaces, punctuation, and a mix of uppercase and lowercase letters.

outputFormat

The output is written to standard output (stdout) as a single line containing either "True" or "False". Output "True" if the two strings are anagrams of each other according to the described criteria, otherwise output "False".## sample

Listen
Silent
True