Infosys Compaz interview question

Max sum subarray from leetcode