John Deere Interview Question

Coding problem dealing with arrays and loops