File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
ํ์ด๋ฐฉ๋ฒ:
15
15
1. Base case: ๋น ๋ฐฐ์ด/none์ผ ๋ True ๋ฐํ
16
- 2. intervals๋ฅผ ์์์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ
17
- 3. prev_end ์ด๊ธฐํ (์ฒซ ๋ฒ์งธ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ)
16
+ 2. ๋ฆฌ์คํธ(ntervals)๋ฅผ ์์์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ
17
+ 3. prev_end(์ฒซ ๋ฒ์งธ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ) ๋ณ์ ์ด๊ธฐํ
18
18
4. ๋ ๋ฒ์งธ ๋ฏธํ
๋ถํฐ ์ํํ๋ฉด์:
19
19
- ๋ง์ฝ ํ์ฌ ์์์ (๋ฏธํ
์์ ์๊ฐ)์ด ์ด์ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ๋ณด๋ค ์์ผ๋ฉด false ๋ฐํ
20
20
- ๊ทธ๋ ์ง ์์ผ๋ฉด prev_end๋ฅผ ํ์ฌ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ์ผ๋ก ์
๋ฐ์ดํธ
21
21
5. ๋ชจ๋ ๋ฏธํ
์ ๊ฒ์ฌํ ํ์๋ ์ถฉ๋์ด ์์ผ๋ฉด true ๋ฐํ
22
+
23
+ ๋ฉ๋ชจ:
24
+
25
+ ๋ณ์๋ช
ํท๊ฐ๋ฆผ:
26
+ - intervals๋ ๋ฆฌ์คํธ -> `.end` ์์ฑ ์์
27
+ - interval์ ๊ฐ์ฒด -> `.end` ์์ฑ ์์
28
+
29
+ ์ ๋ ฌ ๋ฌธ๋ฒ:
30
+ - list.sort(key=lambda x: x.start)
22
31
"""
23
32
from typing import List
24
33
You canโt perform that action at this time.
0 commit comments