Arjun Mehta1 month agoMost voted6
anti hash test. someone made inputs that all collide so every operation became O(n). use a custom hash (splitmix64 with a random seed) or just use map
same solution with map passed. how is O(log n) beating O(1)
anti hash test. someone made inputs that all collide so every operation became O(n). use a custom hash (splitmix64 with a random seed) or just use map
map also gives sorted order and lower_bound, half the time that's why I use it anyway
Structured lessons on DSA, core CS, Java and interview skills, each ending in a quiz so you know it stuck.