All tasks
Mediumstringshashsorting

Anagram Check

Time limit 2 s · Memory 64 MBAcceptance: —Solved by: 0

Statement

Two lines contain two strings of lowercase Latin letters. Print YES if they are anagrams (made of the same letters with the same counts), otherwise NO.

Examples

Example 1
Input
listen
silent
Output
YES
Example 2
Input
hello
world
Output
NO

Constraints

  • Each string has length between 1 and 10^5
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.