#K50777. Anagram Checker

    ID: 28940 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

In this problem, you are given two strings. Your task is to determine whether the two strings are anagrams of each other.

Two strings are considered anagrams if one string can be rearranged to form the other using all the original letters exactly once. Note that the comparison is case-sensitive and includes spaces and special characters.

In mathematical terms, given two strings \(s_1\) and \(s_2\), they are anagrams if:

\[ \text{sorted}(s_1) = \text{sorted}(s_2), \] where \(\text{sorted}(s)\) denotes the string obtained by sorting all the characters in \(s\) in ascending order.

inputFormat

The input consists of two lines.

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

outputFormat

Output a single line containing either True or False (without quotes). Output True if the two strings are anagrams of each other, and False otherwise.

## sample
listen
silent
True