|
| 1 | +<h2><a href="https://leetcode.com/problems/contains-duplicate">Contains Duplicate</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><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> |
| 2 | + |
| 3 | +<p> </p> |
| 4 | +<p><strong class="example">Example 1:</strong></p> |
| 5 | +<pre><strong>Input:</strong> nums = [1,2,3,1] |
| 6 | +<strong>Output:</strong> true |
| 7 | +</pre><p><strong class="example">Example 2:</strong></p> |
| 8 | +<pre><strong>Input:</strong> nums = [1,2,3,4] |
| 9 | +<strong>Output:</strong> false |
| 10 | +</pre><p><strong class="example">Example 3:</strong></p> |
| 11 | +<pre><strong>Input:</strong> nums = [1,1,1,3,3,4,3,2,4,2] |
| 12 | +<strong>Output:</strong> true |
| 13 | +</pre> |
| 14 | +<p> </p> |
| 15 | +<p><strong>Constraints:</strong></p> |
| 16 | + |
| 17 | +<ul> |
| 18 | + <li><code>1 <= nums.length <= 10<sup>5</sup></code></li> |
| 19 | + <li><code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code></li> |
| 20 | +</ul> |
0 commit comments