pointless Existence
Roped
-
- Joined
- Jul 6, 2025
- Posts
- 507
Given an integer array nums, find the subarray with the largest sum and return it's sum
ex:nums = [-2,1,-3,4,-1,2,1,-5,4]
Output : 6 ,subarray= [4,-1,2,1]
ex:nums = [-2,1,-3,4,-1,2,1,-5,4]
Output : 6 ,subarray= [4,-1,2,1]
Python:
def maxsum(nums:List[int]) -> int:





