Pergunta de entrevista da empresa Health Gorilla

Basic algorithm question about a balanced array.