Pregunta de entrevista de Health Gorilla

Basic algorithm question about a balanced array.