Given an integer array `nums`, return `true` if any value appears at least twice.
Examples
Input
nums = [1,2,3,1]
Output
true
Input
nums = [1,2,3,4]
Output
false
Constraints
- 1 <= nums.length <= 10⁵
- -10⁹ <= nums[i] <= 10⁹
Given an integer array `nums`, return `true` if any value appears at least twice.
nums = [1,2,3,1]
true
nums = [1,2,3,4]
false
Explore step-by-step interactive animations, memory state tracking, and live multi-language execution in DrawCode.
Launch Interactive Visualizer