Fill in hasDuplicate so that it returns true when a value appears more than once.
hasDuplicate
true
Keep a set of values already seen; check before adding, otherwise every value looks like a repeat. The program prints true and then false.
false