[LeetCode] Maximum Subarray (javascript)
문제 Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. 문제[번역] 정수 숫자열이 주어집니다. 최소 하나의 숫자를 포함한 연속적 최대 합을 구하세요 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. Example 2 Input: nums = [1] Output: 1 Example 3 Input:..
2022. 3. 7.