#K2936. Anagram Checker
Anagram Checker
Anagram Checker
Given two strings, determine whether they are anagrams of each other. Two strings are considered anagrams if one string can be rearranged to form the other, using all original letters exactly once. The comparison should be case-insensitive and whitespace should be ignored.
In formal terms, for two strings \(s_1\) and \(s_2\), after removing all spaces and converting them to lowercase, they are anagrams if:
[ sorted(s_1) = sorted(s_2) ]
Examples:
- "listen" and "silent" are anagrams.
- "Dormitory" and "dirty room" are anagrams.
- "hello" and "billion" are not anagrams.
inputFormat
The input consists of two lines. The first line contains the first string \(s_1\) and the second line contains the second string \(s_2\).
outputFormat
Print True
if the two strings are anagrams of each other; otherwise, print False
.
listen
silent
True