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)