You are given an integer array nums.
Your task is to determine whether any value appears more than once in the array.
You may assume that:
Return true if any duplicate exists, otherwise return false.
[1, 2, 3, 1]
True
The value 1 appears twice, so we return true.
[1, 2, 3, 4]
False
All elements are distinct, so we return false.
[1, 1, 1, 3, 3, 4, 3, 2, 4, 2]
True
The value 3 appears three times, so we return true.
[1, 2, 3, 1]
True