文章作者:Tyan 博客:noahsnail.com | CSDN | 简书
1. Description
2. Solution
- Version 1
class Solution:
def largestAltitude(self, gain: List[int]) -> int:
highest = 0
altitude = 0
for x in gain:
altitude = x
highest = max(highest, altitude)
return highest
Reference
- https://leetcode.com/problems/find-the-highest-altitude/