#K6971. Anagram Checker

    ID: 33147 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

Given two strings, determine if they are anagrams of each other. Two strings are anagrams if they contain exactly the same characters with the same frequency, possibly in a different order. For example, listen and silent are anagrams.

You can solve this problem by either sorting the strings (which takes \(O(n \log n)\) time) or by using a frequency counter (\(O(n)\) time complexity). Ensure that your solution reads input from stdin and writes output to stdout.

inputFormat

The input consists of exactly two lines:

  • The first line contains the first string.
  • The second line contains the second string.

outputFormat

Output a single line containing True if the two input strings are anagrams of each other, and False otherwise.

## sample
listen
silent
True