Maximum Sum of 3 Non-Overlapping Subarrays
Hard · Dynamic Programming · about 35 minutes
Asked at Meta, Google, Amazon, Microsoft.
Choose three windows of k consecutive elements each, with no element shared between windows, so that the sum over all three windows is as big as possible. Return the three starting positions; when several choices are equally good, return the one that is smallest when compared position by position.