leetle

6. Maximum Subarray

Write a function solve that finds the nonempty contiguous subarray with the largest sum in a list.

Example: Input: [-2,1,-3,4,-1,2,1,-5,4] Output: 6

Make sure you return your solution, don't print!


def solve(nums):
    pass