Coding Challenge

Contains Duplicate

Easy
arrayhashset

Detect whether any value appears at least twice.

Given an integer array, return true if any value appears more than once, otherwise return false.

Examples

Input: nums = [1,2,3,1]

Output: true

Constraints

  • 1 <= nums.length

Preparing your coding workspace...