This is solution for the maximum sub array problem in Javascript .
Problem with example
Input: [-2,1,-3,4,-1,2,1,-5,4],
Output: 6
Explanation: [4,-1,2,1] has the largest sum = 6.
Input: [-2,-11,-13,-2,-14,-9,-5,-15,-3],
Output: -2
Explanation: [-2] has the largest sum = -2.
Input: [-2,0,-1]
Output: 0
Explanation: [0] has the largest sum = 0.
This is solution for the maximum sub array problem in Javascript . Problem with example Input: [-2,1,-3,4,-1,2,1,-5,4], Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6. Input: [-2,-11,-13,-2,-14,-9,-5,-15,-3], Output: -2 Explanation: [-2] has the largest sum = -2. Input: [-2,0,-1] Output: 0 Explanation: [0] has the largest sum = 0.
Please accept for the purpose of Hacktoberfest