Check Anagram
Easyjavapythonccppjavascript
Given two strings, determine whether they contain exactly the same characters with the same frequencies, regardless of order.
Input Format
The first line contains string A. The second line contains string B. Neither string contains spaces.
Output Format
Print 1 if A and B are anagrams, otherwise print 0.
Example 1
Input
listen silent
Output
1
Explanation: Both strings contain the same letters with the same counts.
- 1 <= length of A, B <= 100000
- Both strings consist of lowercase English letters.