Skip to content
C

Maximum Subarray Sum

Mediumjavapythonccppjavascript

Find the maximum possible sum of a non-empty contiguous subarray of the given array.

Input Format

The first line contains an integer N. The second line contains N space-separated integers.

Output Format

Print the maximum subarray sum.

Input (stdin)

Output

Run your code to see output here...