tech-interview-handbook icon indicating copy to clipboard operation
tech-interview-handbook copied to clipboard

error: space complexity is mentioned as O(logn) instead of O(n) in Anagrams section of String

Open The-East-Wind opened this issue 11 months ago • 1 comments

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).

The-East-Wind avatar Jan 13 '25 19:01 The-East-Wind

Can i fix this.

atharva0711502 avatar Mar 22 '25 10:03 atharva0711502