Always good to start with simpler things first. Problem Statement:
Problem is to find the maximum subarray sum possible of all the non-empty subarrays given integer array.
Example: Input: [-37, -7, 5, 1, 2, -4, 7, -1]
Output: 11
Subarray [5, 1, 2, -4, 7] is the max sum contiguous subarray with…