X562: isUnique

This method takes an array of integers as a parameter. It returns true if the elements in the array are unique, false otherwise. For example, if the array passed stores {12, 7, -1, 25, 3}, your method should return true; if the array passed stores {5, 3, 5, 2}, your method should return false. An array with 0 or 1 element should be considered unique.

Examples:

isUnique({12, 7, -1, 25, 3}) -> true
isUnique({5, 3, 5, 2}) -> false

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.