Lendbuzz interview question

Maximum Subarray LC question on coderpad