Hello Codeforces.↵
Recently I faced a problem which I couldn't solve in an hour.↵
It is as follows: Max Sum Subarray of atleast 2 numbers.↵
Of course, for just max sum subarray it is Kadane's algorithm in O(n) time, however, I couldn't think of a way to solve for atleast 2 numbers faster than O(n^2). Any idea or a solution?↵
↵
**UPD**: Thanks everyone. Now I know how to solve this problem
Recently I faced a problem which I couldn't solve in an hour.↵
It is as follows: Max Sum Subarray of atleast 2 numbers.↵
Of course, for just max sum subarray it is Kadane's algorithm in O(n) time, however, I couldn't think of a way to solve for atleast 2 numbers faster than O(n^2). Any idea or a solution?↵
↵
**UPD**: Thanks everyone. Now I know how to solve this problem