MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / addNum

Method addNum

src/class194/Code08_Tourists1.java:74–79  ·  view source on GitHub ↗
(int u, int num)

Source from the content-addressed store, hash-verified

72 }
73
74 public static void addNum(int u, int num) {
75 if (!maps.containsKey(u)) {
76 maps.put(u, new TreeMap<>());
77 }
78 maps.get(u).put(num, maps.get(u).getOrDefault(num, 0) + 1);
79 }
80
81 public static void delNum(int u, int num) {
82 int cnt = maps.get(u).get(num);

Callers 2

dfs1Method · 0.95
mainMethod · 0.95

Calls 2

putMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected