Mastercard interview question

Kadane algorithm based array question