5 kyu
Maximum subarray sum
1,098 of 83,699knotman90
Description:
The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers:
maxSequence [-2, 1, -3, 4, -1, 2, 1, -5, 4]
-- should be 6: [4, -1, 2, 1]
Easy case is when the list is made up of only positive numbers and the maximum sum is the sum of the whole array. If the list is made up of only negative numbers, return 0 instead.
Empty list is considered to have zero greatest sum. Note that the empty list or array is also a valid sublist/subarray.
Algorithms
Lists
Dynamic Programming
Fundamentals
Performance
Similar Kata:
Stats:
Created | Oct 30, 2014 |
Published | Oct 30, 2014 |
Warriors Trained | 194470 |
Total Skips | 42096 |
Total Code Submissions | 418697 |
Total Times Completed | 83699 |
Haskell Completions | 1098 |
JavaScript Completions | 26562 |
Python Completions | 31409 |
Clojure Completions | 281 |
Java Completions | 10254 |
Ruby Completions | 1872 |
Go Completions | 1593 |
C# Completions | 4496 |
C Completions | 1935 |
C++ Completions | 4623 |
Kotlin Completions | 693 |
Rust Completions | 658 |
Scala Completions | 90 |
COBOL Completions | 6 |
Total Stars | 4269 |
% of votes with a positive feedback rating | 89% of 6681 |
Total "Very Satisfied" Votes | 5385 |
Total "Somewhat Satisfied" Votes | 1065 |
Total "Not Satisfied" Votes | 231 |