Skip to content

Latest commit

 

History

History
 
 

017-sum-of-integers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Sum of integers

Challenge Description:

Write a program to determine the largest sum of contiguous integers in a list.

Input sample:

The first argument is a path to a filename containing a comma-separated list of integers, one per line.

For example:

-10,2,3,-2,0,5,-15
2,3,-2,-1,10

Output sample:

Print to stdout the largest sum. In other words, of all the possible contiguous subarrays for a given array, find the one with the largest sum, and print that sum.

For example:

8
12