#C8213. Anagram Checker

    ID: 52171 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

Given two strings s and t, determine if t is an anagram of s. Two strings are anagrams if and only if they have the same characters with the same frequency. More formally, given two strings \( s \) and \( t \), check whether

[ |s| = |t| \quad \text{and} \quad \forall c, \ count_{s}(c) = count_{t}(c) ]

where \( count_{s}(c) \) denotes the number of occurrences of the character \( c \) in \( s \). Your task is to write a program that reads two strings from standard input and prints "True" if they are anagrams of each other, and "False" otherwise.

inputFormat

The input consists of two lines. The first line contains the string s, and the second line contains the string t. Both strings consist of lowercase English letters.

outputFormat

Output a single line: "True" if the string t is an anagram of s, otherwise "False".## sample

anagram
nagaram
True