← All problems
Time Based Key-Value Store
set(key, value, timestamp); get(key, timestamp) returns the latest value at or before timestamp.
Complexity
Time O(log n) get, Space O(n)
Common pitfalls
- Linear scan per get
- Leftmost vs rightmost binary search confusion
Your solution
Log in to save your code and track progress.