JAVA Solution || 0 MS
\nclass Solution {\n    public int largestAltitude(int[] gain) {\n     int max=0;\n     int sum=0;\n     for(int i=0;i<gain.length;i++){\n       sum+=gain[i];\n
```\nclass Solution {\n    public int largestAltitude(int[] gain) {\n     int max=0;\n     int sum=0;\n     for(int i=0;i<gain.length;i++){\n       sum+=gain[i];\n       max=Math.max(max,sum);\n     }\n    return max;\n    }\n}\n```
['Java']