John Deere Interview Question

The coding round was based on arrays.