codesONLY / JavaScriptONLY

Knowledge Resource of core fundamentals of JavaScript explained in simple way!
378 stars 182 forks source link

Create Maximumsubarray.js #46

Closed viswakash closed 2 years ago

viswakash commented 2 years ago

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

viswakash commented 2 years ago

Thank you for accepting

sohamsshah commented 2 years ago

Thanks @viswakash for this addition.