2022-03-27 20:56:26 +08:00
< p > Given an integer array < code > nums< / code > , return < code > true< / code > if any value appears < strong > at least twice< / strong > in the array, and return < code > false< / code > if every element is distinct.< / p >
< p > < / p >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 1:< / strong > < / p >
2022-03-27 20:56:26 +08:00
< pre > < strong > Input:< / strong > nums = [1,2,3,1]
< strong > Output:< / strong > true
2023-12-09 18:42:21 +08:00
< / pre > < p > < strong class = "example" > Example 2:< / strong > < / p >
2022-03-27 20:56:26 +08:00
< pre > < strong > Input:< / strong > nums = [1,2,3,4]
< strong > Output:< / strong > false
2023-12-09 18:42:21 +08:00
< / pre > < p > < strong class = "example" > Example 3:< / strong > < / p >
2022-03-27 20:56:26 +08:00
< pre > < strong > Input:< / strong > nums = [1,1,1,3,3,4,3,2,4,2]
< strong > Output:< / strong > true
< / pre >
< p > < / p >
< p > < strong > Constraints:< / strong > < / p >
< ul >
< li > < code > 1 < = nums.length < = 10< sup > 5< / sup > < / code > < / li >
< li > < code > -10< sup > 9< / sup > < = nums[i] < = 10< sup > 9< / sup > < / code > < / li >
< / ul >