Pick an example, and start in the middle
Figure out the end of the loop
Figure out the beginning. What values do the variables need to start?
Figure out any corner cases (such as empty array)