Leetcode | 52. Maximum Subarray | Java | C#
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.
Example 1:
Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: 6
Explanation: [4,-1,2,1] has the largest sum = 6.
Sur cette page du site, vous pouvez voir la vidéo en ligne Leetcode | 52. Maximum Subarray | Java | C# durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur CodeOnline 10 octobre 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 623 fois et il a aimé 4 téléspectateurs. Bon visionnage!