LEARNAPP Hiring | On-Campus OA (2024) | Find the Highest Altitude
Question · Posted Jun 2026
Problem Statement A biker starts a road trip at altitude 0. You are given an integer array gain, where gain[i] represents the net altitude change between point i and point i + 1. Return the highest altitude reached during the trip. Example Input gain = [-5,1,5,0,-7] Output 1 Explanation Altitude changes: Start = 0 After -5 → -5 After +1 → -4 After +5 → 1 After 0 → 1 After -7 → -6 The highest altitude reached is 1. ...
The full answer & interview discussion are available to premium members.
Log in Create a free account