Max Sum Subarray of atleast 2 numbers
Difference between en1 and en2, changed 66 character(s)
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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Timosh 2024-04-20 20:39:35 66
en1 English Timosh 2024-04-20 19:37:16 362 Initial revision (published)