add followup for chap9-3 to deal with the case of nondistinct elements in the array