#K45337. Anagrams Checker
Anagrams Checker
Anagrams Checker
Given two strings a and b, determine whether they are anagrams of each other. Two strings are anagrams if and only if they contain the same characters with the same frequencies. In mathematical terms, for every character \( c \), it must hold that
[ \text{count}_a(c) = \text{count}_b(c) ]
Your task is to read two strings from standard input and print True
if they are anagrams, or False
otherwise.
inputFormat
The input consists of two lines. The first line contains the first string a, and the second line contains the second string b.
outputFormat
Output a single line with either True
or False
depending on whether the two strings are anagrams of each other.
listen
silent
True