Skip to content

Commit d55508f

Browse files
committed
Markdown Documentation Comments
1 parent ec5a208 commit d55508f

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

src/test/java/com/github/streams/interview/problems/numbers/A_LargestConsecutiveSequence.java

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,31 @@
66
import org.junit.jupiter.api.Disabled;
77
import org.junit.jupiter.api.Test;
88

9-
/**
10-
* Given an unsorted array of integers nums, return the length of the longest consecutive elements
11-
* sequence. <br>
12-
* You must write an algorithm that runs in O(n) time. <br>
13-
* Example 1: <br>
14-
* Input: nums = [100,4,200,1,3,2]<br>
15-
* Output: 4<br>
16-
* Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is
17-
* 4.<br>
18-
* <br>
19-
* <br>
20-
* Example 2:<br>
21-
* <br>
22-
* Input: nums = [0,3,7,2,5,8,4,6,0,1]<br>
23-
* Output: 9<br>
24-
* <br>
25-
*/
9+
/// ### Longest Consecutive Sequence
10+
///
11+
/// Given an unsorted array of integers `nums`, return the length of the longest consecutive elements
12+
/// sequence.
13+
///
14+
/// You must write an algorithm that runs in $O(n)$ time.
15+
///
16+
/// ### Example 1:
17+
///
18+
/// ```
19+
/// Input: nums = [100, 4, 200, 1, 3, 2]
20+
/// ```
21+
/// ```
22+
/// Output: 4
23+
/// ```
24+
/// Explanation: The longest consecutive elements sequence is `[1, 2, 3, 4]`. Therefore its length is 4.
25+
///
26+
/// ### Example 2:
27+
///
28+
/// ```
29+
/// Input: nums = [0, 3, 7, 2, 5, 8, 4, 6, 0, 1]
30+
/// ```
31+
/// ```
32+
/// Output: 9
33+
/// ```
2634
class A_LargestConsecutiveSequence {
2735
@Test
2836
@Disabled

0 commit comments

Comments
 (0)