filmov
tv
Dynamic Programming - Maximum Subarray Problem | Intermediate Level

Показать описание
The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers that has the largest sum.
Example:
int [] A = {−2, 1, −3, 4, −1, 2, 1, −5, 4};
Output: contiguous subarray with the largest sum is 4, −1, 2, 1, with sum 6.