Java best solution for Kadane Algo

programming
Tags: #<Tag:0x00007f182574e660>

#1

. .public int maxSubArray(final int[] A) {

    int max_current=A[0];
     int max_global=A[0];
    for(int i=1;i<A.length;i++){
        max_current=Math.max(A[i],max_current+A[i]);
        if(max_current>max_global)
        max_global=max_current;
    }
    return max_global;
}`