Sokrati interview question

question based on kadane algorithm