We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3263214 commit acc9b9eCopy full SHA for acc9b9e
my-submissions/m981.py
@@ -0,0 +1,22 @@
1
+class TimeMap:
2
+
3
+ def __init__(self):
4
+ self.vals = {}
5
6
+ def set(self, key: str, value: str, timestamp: int) -> None:
7
+ if key not in self.vals :
8
+ self.vals[key] = [[], []]
9
+ self.vals[key][0].append(value)
10
+ self.vals[key][1].append(timestamp)
11
12
+ def get(self, key: str, timestamp: int) -> str:
13
14
+ return ''
15
+ if timestamp < self.vals[key][1][0] :
16
17
+ return self.vals[key][0][bisect_right(self.vals[key][1], timestamp) - 1]
18
19
+# Your TimeMap object will be instantiated and called as such:
20
+# obj = TimeMap()
21
+# obj.set(key,value,timestamp)
22
+# param_2 = obj.get(key,timestamp)
0 commit comments