Microsoft VO Question

Implement a data structure that can support the following operations:
(1) Insert a key-value pair
(2) Delete a key
(3) Increase/Decrease the value associated with a key (note that the increase/decrease amount can be anything)
(4) Find the keys with max and min value

I think it's similar to the AllOne problem on here, but the problem is (3) allows for increase/decrease by any arbitrary amount. Is this possible to do all the operations in O(1)?

Comments (2)