#K8381. Anagram Checker
Anagram Checker
Anagram Checker
Given two strings, determine whether they are anagrams of each other. Two strings are anagrams if they consist of exactly the same characters when spaces are removed and letters are converted to lowercase. For example, "Listen" and "Silent" are anagrams.
In mathematical terms, let \( s_1 \) and \( s_2 \) be the strings after removing spaces and converting to lowercase. Then the two strings are anagrams if and only if
[ sorted(s_1) = sorted(s_2) ]
where sorted(s)
denotes the string obtained by arranging all characters of s
in non-decreasing order.
Your task is to implement a program that reads two lines from standard input (stdin) and prints a single line to standard output (stdout) with True
if the strings are anagrams and False
otherwise.
inputFormat
The input consists of two lines. Each line contains a non-empty string. The strings can include spaces and letters in mixed cases.
outputFormat
Output a single line: True
if the two processed strings are anagrams of each other; otherwise, output False
.
Listen
Silent
True