Health Gorilla interview question

Basic algorithm question about a balanced array.