Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Contiguous Sequence

You are given an array of integers(both positive and negative). Find the contiguous sequence with the largest sum. Return the sum. EXAMPLE Input: 2, -8, 3, -2, 4, -10 Output: 5 (i.e., {3, -2, 4})

Solutions:

Swift

O(n)

C++

O(n)

Installation

Run make to build and run C++ files and run Swift files. Or you can run .playground file.