CHALLENGES

Back to home page
  • 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

Login to submit solution