-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Bug Report for https://neetcode.io/problems/is-anagram
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Recommended Time & Space Complexity
You should aim for a solution with O(n + m) time and O(1) space, where n is the length of the string s and m is the length of the string t.
Hint 3
We can just consider maintaining the frequency of each character. We can do this by having two separate hash tables for the two strings. Then, we can check whether the frequency of each character in string s is equal to that in string t and vice versa.
Creation of two Maps is not O(1) space.
Metadata
Metadata
Assignees
Labels
No labels