100% faster solution
\nclass Solution {\n    public int largestAltitude(int[] gain) {\n        int sum=0; \n        int max=0;\n        for(int i=0;i<gain.length;i++){\n           s
```\nclass Solution {\n    public int largestAltitude(int[] gain) {\n        int sum=0; \n        int max=0;\n        for(int i=0;i<gain.length;i++){\n           sum=sum + gain[i]; \n           if(sum>max)\n               max=sum;\n        }\n        return max;\n    }\n}\n\n\n```
['Java']