Detect Array Duplicate
ARRAY
HASH TABLE

Problem

Given a list of integers nums, determine whether any number appears more than once.

If any value is repeated, return true; otherwise, return false, indicating all elements in the array are unique.

Examples

hasDuplicates([4, 5, 6, 7]) // return false hasDuplicates([10, 20, 10, 30]) // return true
Loading...
Loading...
Loading...