Challenge: Maximum Subarray Sum

Maximum subarray sum

💰 In a given unsorted array, the maximum sum of a continuous subarray is the one who’s elements, when added together, give the largest possible sum.

This problem is a tricky one because the array might have negative integers in any position. Therefore, we have to cater to those negative integers while choosing the continuous subarray with the largest positive values.

Extreme cases

Have a look at the following extreme/boundary cases for a closer understanding of the problem.

Case 1: When all entries are positive

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.