Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
findUnsortedSubarray
Method · 0.45
Calls
2
get
Method · 0.45
remove
Method · 0.45
Tested by
1
findUnsortedSubarray
Method · 0.36