Skip to content

Latest commit

 

History

History

challenge-43

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Contiguous Subarray with Maximum Sum

This problem was asked by Twitter.

Description

You are given an array of integers. Find the maximum sum of all possible contiguous subarrays of the array.

Your solution should run in linear time.

Example

Input: [34, -50, 42, 14, -5, 86]
Output: 137 ([42, 14, -5, 86])