You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Anagrams section of the Strings cheatsheet the space complexity of the approach where sorting both the input strings to determine it they are anagrams or not is mentioned as O(logn) but the actual space complexity is O(n) (since we'll need 2 additional strings of size n for storing sorted copy of the 2 input strings).
The text was updated successfully, but these errors were encountered:
Issue
In the
Anagrams
section of the Strings cheatsheet the space complexity of the approach where sorting both the input strings to determine it they are anagrams or not is mentioned asO(logn)
but the actual space complexity isO(n)
(since we'll need 2 additional strings of sizen
for storing sorted copy of the 2 input strings).The text was updated successfully, but these errors were encountered: