Problem Description

Print the maximum subarray sum (Kadane).

Input Format

First n. Next line n integers.

Output Format

One integer maxSum.

Sample Test Case

Input:
9 -2 1 -3 4 -1 2 1 -5 4
Output:
6

Constraints

n

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next