Leetcode | 52. Maximum Subarray | Java | C#

Опубликовано: 10 Октябрь 2020
на канале: 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.


На этой странице сайта вы можете посмотреть видео онлайн Leetcode | 52. Maximum Subarray | Java | C# длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь CodeOnline 10 Октябрь 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 623 раз и оно понравилось 4 зрителям. Приятного просмотра!