-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c671d2
commit 184a084
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<h2><a href="https://leetcode.com/problems/contains-duplicate/">217. Contains Duplicate</a></h2><h3>Easy</h3><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> | ||
|
||
<p> </p> | ||
<p><strong class="example">Example 1:</strong></p> | ||
|
||
<div class="example-block"> | ||
<p><strong>Input:</strong> <span class="example-io">nums = [1,2,3,1]</span></p> | ||
|
||
<p><strong>Output:</strong> <span class="example-io">true</span></p> | ||
|
||
<p><strong>Explanation:</strong></p> | ||
|
||
<p>The element 1 occurs at the indices 0 and 3.</p> | ||
</div> | ||
|
||
<p><strong class="example">Example 2:</strong></p> | ||
|
||
<div class="example-block"> | ||
<p><strong>Input:</strong> <span class="example-io">nums = [1,2,3,4]</span></p> | ||
|
||
<p><strong>Output:</strong> <span class="example-io">false</span></p> | ||
|
||
<p><strong>Explanation:</strong></p> | ||
|
||
<p>All elements are distinct.</p> | ||
</div> | ||
|
||
<p><strong class="example">Example 3:</strong></p> | ||
|
||
<div class="example-block"> | ||
<p><strong>Input:</strong> <span class="example-io">nums = [1,1,1,3,3,4,3,2,4,2]</span></p> | ||
|
||
<p><strong>Output:</strong> <span class="example-io">true</span></p> | ||
</div> | ||
|
||
<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> |