Runtime: 9 ms, faster than 5.84% of Java online submissions for Maximum Subarray. Memory Usage: 74.1 MB, less than 41.86% of Java online submissions for Maximum Subarray. 시간복잡도: O(n) - 아래 나올 Solution ...
int sum=0,ans=0,l=0,r=0; //sum will store curr_sum,l will point to left boundary and r will point ot right boundary,ans will store length of longest segment. Subarray starting with 4: 4 2 1 is a ...