We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Max Array Sum
- Discussions
Max Array Sum
Max Array Sum
Sort by
recency
|
484 Discussions
|
Please Login in order to post a comment
same to https://www.hackerrank.com/challenges/maxsubarray/problem
Simple Python Solution - fully commented and easy to understand, also takes into account 1 element case (test cases don't cover this):
C#
Here is a node solution. I tried to make it as readable as possible: For Dynamic Programmin, you want to keep track of the base cases before you start looping. During your looping, you still want to keep track of what you are looking for on each index so that the later indexes can access them without needing to do recalculations. It is crutial to do as little calculations as possible. Take a look: