leetcode

242. Valid Anagram

Map solution

n = |s, t|

Time complexity: O(n)

Space complexity: O(n)

Alphabet solution

n = |s, t|

Time complexity: O(n)

k = |alphabet| = 26

Space complexity: O(k)