Pregunta de entrevista de Mastercard

Kadane algorithm based array question