Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/qiyuangong/leetcode
/ push
Method
push
java/716_Max_Stack.java:10–15 ·
view source on GitHub ↗
(int x)
Source
from the content-addressed store, hash-verified
8
}
9
10
public
void
push(
int
x) {
11
Node node = dll.add(x);
12
if
(!map.containsKey(x))
13
map.put(x,
new
ArrayList<Node>());
14
map.get(x).add(node);
15
}
16
17
public
int
pop() {
18
int
val = dll.pop();
Callers
1
findUnsortedSubarray
Method · 0.45
Calls
4
containsKey
Method · 0.80
add
Method · 0.45
put
Method · 0.45
get
Method · 0.45
Tested by
1
findUnsortedSubarray
Method · 0.36