MCPcopy Index your code
hub / github.com/neetcode-gh/leetcode / set

Method set

java/0981-time-based-key-value-store.java:9–12  ·  view source on GitHub ↗
(String key, String value, int timestamp)

Source from the content-addressed store, hash-verified

7 }
8
9 public void set(String key, String value, int timestamp) {
10 if (!map.containsKey(key)) map.put(key, new ArrayList<>());
11 map.get(key).add(new Pair(value, timestamp));
12 }
13
14 public String get(String key, int timestamp) {
15 if (!map.containsKey(key)) return "";

Callers 4

removeMethod · 0.45
shiftGridMethod · 0.45
lengthOfLISMethod · 0.45
getRowMethod · 0.45

Calls 3

putMethod · 0.45
addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected