#C14536. Anagram Checker

    ID: 44196 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, taking into account only alphanumeric characters and ignoring the case. That is, you need to ignore all characters that are not in the set ( [0-9a-zA-Z] ) and compare the strings in a case-insensitive manner.

Note that you are not allowed to use any built-in sorting functionalities. Instead, you should implement an algorithm (for example, using a frequency count) to decide if the two strings are anagrams in ( O(n) ) time, where ( n ) is the length of the cleaned strings.

The program should read from standard input two lines where each line contains one string, and should output a single line with either "True" or "False".

inputFormat

The input consists of two lines read from standard input. The first line contains the first string and the second line contains the second string. The strings can include alphanumeric characters, spaces, punctuation, and other symbols.

outputFormat

Output a single line to standard output with either "True" if the two strings are anagrams of each other (ignoring case and non-alphanumeric characters) or "False" otherwise.## sample

Astronomer
Moonstarer
True