DiverseArray free response answer 12

DiverseArray free response problem from the 2015 AP Computer Science A Exam.