Frage im Vorstellungsgespräch bei IBM

Coding Question: Figuring out a condition for elements in an array