Skip to content

Commit fe5c45a

Browse files
committed
Create README - LeetHub
1 parent f67831f commit fe5c45a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h2><a href="https://leetcode.com/problems/longest-consecutive-sequence">128. Longest Consecutive Sequence</a></h2><h3>Medium</h3><hr><p>Given an unsorted array of integers <code>nums</code>, return <em>the length of the longest consecutive elements sequence.</em></p>
2+
3+
<p>You must write an algorithm that runs in&nbsp;<code>O(n)</code>&nbsp;time.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> nums = [100,4,200,1,3,2]
10+
<strong>Output:</strong> 4
11+
<strong>Explanation:</strong> The longest consecutive elements sequence is <code>[1, 2, 3, 4]</code>. Therefore its length is 4.
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> nums = [0,3,7,2,5,8,4,6,0,1]
18+
<strong>Output:</strong> 9
19+
</pre>
20+
21+
<p>&nbsp;</p>
22+
<p><strong>Constraints:</strong></p>
23+
24+
<ul>
25+
<li><code>0 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
26+
<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
27+
</ul>

0 commit comments

Comments
 (0)