Skip to content

Commit 1f55061

Browse files
committed
solve: longest consecutive sequence
1 parent 649b32c commit 1f55061

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

β€Žlongest-consecutive-sequence/wogha95.jsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SC: O(N)
44
* nums의 μˆ«μžμ— μ ‘κ·Όν•˜λŠ” νšŸμˆ˜λŠ” 2λ²ˆμ—μ„œ N만큼, 4λ²ˆμ—μ„œ μ΅œλŒ€ N만큼 μž…λ‹ˆλ‹€.
55
* 즉, 2N번 만큼 nums의 μˆ«μžμ— μ ‘κ·Όν•©λ‹ˆλ‹€.
6+
* N^2이 μ•„λ‹Œ 이유: N^2이 μ•„λ‹Œ 2N으둜 μƒκ°ν•œ μ΄μœ λŠ” 2λ²ˆμ—μ„œ N번의 순회λ₯Ό ν•˜μ§€λ§Œ 각 μˆœνšŒκ°€ μ„œλ‘œμ—κ²Œ 영ν–₯을 미치기 λ•Œλ¬Έμ— μ΅œλŒ€ μˆœνšŒλŠ” 2N으둜 κ³„μ‚°ν–ˆμŠ΅λ‹ˆλ‹€. (1번의 N 순회 μ œμ™Έ)
7+
* @see https://github.com/DaleStudy/leetcode-study/pull/408#discussion_r1747071917
68
*/
79

810
/**

0 commit comments

Comments
Β (0)