-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
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.
The space complexity for Hash Map solution is wrong.
Current:
Space complexity: O(1) since we have at most 26 different characters.
Correct:
Space complexity: O(n+m) where n is the length of string s and m is the length of string t.
Explanation: Since we are building two hashmaps countS and countT which potentially store characters up to the size of string s + string t.
Metadata
Metadata
Assignees
Labels
No labels