53
-
[LeetCode] 53. Maximum SubarrayLeetCode 2021. 11. 25. 11:55
https://leetcode.com/problems/maximum-subarray/ Maximum Subarray - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Maximum Subarray - Easy 배열이 주어졌을때, 이 배열의 연속된 부분 배열의 합의 최대값을 구하는 문제다. 처음 최대값 ret을 INT_MIN (-2^31) 으로 두고, 합을 나타내는 S를 0으로 두자. 그 뒤 배열을 훑으며 S = S + 해당값 으로 바꿔주고, ret = max(r..