GoLang Solution For LeetCode Problem: Maximum Subarray
Solving Maximum Subarray in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Input: [-2,1,-3,4,-1,2,1,-5,4], Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6.
If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.
See the full details of the problem Maximum Subarray at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go