Pergunta de entrevista da empresa PayPal

One array was given and we need to find maximum subarray length such that given condition is satisfied.