Leetcode | 52. Maximum Subarray | Java | C#

Pubblicato il: 10 ottobre 2020
sul canale di: CodeOnline
623
4

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.


In questa pagina del sito puoi guardare il video online Leetcode | 52. Maximum Subarray | Java | C# della durata di ore minuti seconda in buona qualità , che l'utente ha caricato CodeOnline 10 ottobre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 623 volte e gli è piaciuto 4 spettatori. Buona visione!