Sokrati Interview Question

question based on kadane algorithm