Swift | 1732. Find the Highest Altitude | One-liner
Using a tuple to keep track of the (height, maxSoFar) and reducing over the gains:\nswift \nfunc largestAltitude(_ gain: [Int]) -> Int {\n    gain.reduce((0,0))
Using a tuple to keep track of the (height, maxSoFar) and reducing over the gains:\n```swift \nfunc largestAltitude(_ gain: [Int]) -> Int {\n    gain.reduce((0,0)) { ($0.0+$1, max($0.1, $0.0+$1)) }.1\n}\n```
['Swift']