Grokking Meta Coding Interview
Vote

0% completed

Hidden Document
Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content Hidden Document Content

.....

.....

.....

Like the course? Get enrolled and start learning!
N

Nicholas Tinsley

· 2 years ago

Is it actually cheaper to allocate a hash map and access its elements rather than just going through both sparse arrays at the same time? In either case, you have to iterate through each array and you have to do an equality check against 0; I don't understand how using the additional space complexity and the (constant but existent) overhead of a hash map optimizes the operation.

Show 1 reply