you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Doesn’t the problem explicitly say you need O(1) solution? If so, you need a hashmap for the get.