Submission Detail

80 / 80 test cases passed.
Status:

Accepted

Runtime: 0 ms
Memory Usage: 40.8 MB
Submitted: 0 minutes ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
75
80
85
90
95
100
105
110
java
Runtime (ms)
Distribution (%)

0
1
2
3
4
5
6
7
8
9
10
80
90
100
110
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

38000
38250
38500
38750
39000
39250
39500
39750
40000
40250
40500
2.5
5.0
7.5
10.0
12.5
15.0
java
Memory (KB)
Distribution (%)

38000
38250
38500
38750
39000
39250
39500
39750
40000
40250
40500
5
10
15
Zoom area by dragging across this chart

Invite friends to challenge Find the Highest Altitude


Submitted Code: 0 minutes ago

Language: java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Solution {
public int largestAltitude(int[] gain) {
int max = 0;
int last = 0;
for (int i = 0; i < gain.length; i++) {
if (last + gain[i] > max)
max = last + gain[i];
last += gain[i];
}
return max;
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX