Find the Highest Altitude | Java
Code\n\nclass Solution {\n    public int largestAltitude(int[] gain) {\n        int highestAltitude = 0;\n        int altitude = 0;\n\n        for (int i = 0; i
# Code\n```\nclass Solution {\n    public int largestAltitude(int[] gain) {\n        int highestAltitude = 0;\n        int altitude = 0;\n\n        for (int i = 0; i < gain.length; i++) {\n            altitude += gain[i]; \n\n            if (altitude > highestAltitude)\n                highestAltitude = altitude;\n        }\n\n        return highestAltitude;\n    }\n}\n```
['Array', 'Prefix Sum', 'Java']