Skip to content

Commit 944bdf3

Browse files
Create README - LeetHub
1 parent 3d16449 commit 944bdf3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

0645-set-mismatch/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<h2><a href="https://leetcode.com/problems/set-mismatch/">645. Set Mismatch</a></h2><h3>Easy</h3><hr><div><p>You have a set of integers <code>s</code>, which originally contains all the numbers from <code>1</code> to <code>n</code>. Unfortunately, due to some error, one of the numbers in <code>s</code> got duplicated to another number in the set, which results in <strong>repetition of one</strong> number and <strong>loss of another</strong> number.</p>
2+
3+
<p>You are given an integer array <code>nums</code> representing the data status of this set after the error.</p>
4+
5+
<p>Find the number that occurs twice and the number that is missing and return <em>them in the form of an array</em>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
<pre><strong>Input:</strong> nums = [1,2,2,4]
10+
<strong>Output:</strong> [2,3]
11+
</pre><p><strong class="example">Example 2:</strong></p>
12+
<pre><strong>Input:</strong> nums = [1,1]
13+
<strong>Output:</strong> [1,2]
14+
</pre>
15+
<p>&nbsp;</p>
16+
<p><strong>Constraints:</strong></p>
17+
18+
<ul>
19+
<li><code>2 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
20+
<li><code>1 &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
21+
</ul>
22+
</div>

0 commit comments

Comments
 (0)