Two ways to solve this:
Build frequency maps for both strings, compare them. Time: , Space: where is alphabet size.
Build one frequency map for , then decrement for each character in . If any count goes negative or non-zero counts remain, not an anagram. Both work. The second uses less space if you're careful.