MCPcopy
hub / github.com/qiyuangong/leetcode / pop

Method pop

java/716_Max_Stack.java:17–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 }
16
17 public int pop() {
18 int val = dll.pop();
19 List<Node> L = map.get(val);
20 L.remove(L.size() - 1);
21 if (L.isEmpty()) map.remove(val);
22 return val;
23 }
24
25 public int top() {
26 return dll.peek();

Callers 1

findUnsortedSubarrayMethod · 0.45

Calls 2

getMethod · 0.45
removeMethod · 0.45

Tested by 1

findUnsortedSubarrayMethod · 0.36