X1705: Has Duplicates?

Given an array of integers, return true if there is any duplicate in the array. If there are no duplicates, then return false. Note that the array might be empty (i.e. 0 length array).

Examples:

duplicates({0,1,2,5}) -> false
duplicates({0,1,2,1}) -> true

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.