#K88507. Anagrams Checker

    ID: 37323 Type: Default 1000ms 256MiB

Anagrams Checker

Anagrams Checker

You are given two strings. Your task is to determine if the two strings are anagrams of each other. Two strings are considered anagrams if they consist of the same characters with the same frequencies, but possibly in a different order. In other words, given two strings \(s_1\) and \(s_2\), they are anagrams if and only if:

\( \text{count}_{s_1}(c) = \text{count}_{s_2}(c) \quad \forall c \in \text{charset}\)

The comparison is case-sensitive and white spaces (if any) are treated as ordinary characters. For example:

  • listen and silent are anagrams.
  • hello and billion are not anagrams.

Your solution should read input from standard input and write the result to standard output.

inputFormat

The input consists of two lines:

  1. The first line contains the first string \(s_1\).
  2. The second line contains the second string \(s_2\).

outputFormat

Output a single line containing either True if \(s_1\) and \(s_2\) are anagrams, or False otherwise.

## sample
listen
silent
True