Java || Easy || 0 ms Solution || Beats 100%
`\n \xA0  class Solution {\n    public int largestAltitude(int[] gain) {\n        int alt[]=new int[gain.length+1];\n        alt[0]= 0;\n        int max=alt[0];
````\n \xA0  class Solution {\n    public int largestAltitude(int[] gain) {\n        int alt[]=new int[gain.length+1];\n        alt[0]= 0;\n        int max=alt[0];\n        for(int i=1;i<alt.length;i++){\n            alt[i]=alt[i-1]+gain[i-1]; \n            if(alt[i]>max)\n               max=alt[i];\n        }   \n        return(max);\n    }\n}```
[]