Fixed a bug on the second exercise where entering a maximum value in the first prompt yields the wrong index.