Indus Valley Partners interview question

Round 1 - Q.2 code for largest sum subarray.