Infosys interview question

Q. Maximum subarray, leetcode medium question.