You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i = bisect.bisect(valueList, (timestamp, chr(127)))
return valueList[i - 1][1] if i else ""
# Your TimeMap object will be instantiated and called as such:
kv = TimeMap()
kv.set("foo", "bar", 1); # store the key "foo" and value "bar" along with timestamp = 1
kv.get("foo", 1); # output "bar"
kv.get("foo", 3); # output "bar" since there is no value corresponding to foo at timestamp 3 and timestamp 2, then the only value is at timestamp 1 ie "bar"