tech-interview-handbook
tech-interview-handbook copied to clipboard
error: space complexity is mentioned as O(logn) instead of O(n) in Anagrams section of String
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 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).
Can i fix this.