Infosys Interview Question

Question on the kadene's Algorithm