1732. 找到最高海拔
小于 1 分钟
1732. 找到最高海拔简单
class Solution {
public int largestAltitude(int[] gain) {
int res = 0;
int high = 0;
for (int i : gain) {
high += i;
res = Math.max(high,res);
}
return res;
}
}
Powered by Waline v2.15.5