ZS Associates interview question

Maximum sum array