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 1313
1414ํ์ด๋ฐฉ๋ฒ:
15151. Base case: ๋น ๋ฐฐ์ด/none์ผ ๋ True ๋ฐํ
16- 2. intervals๋ฅผ ์์์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ
17- 3. prev_end ์ด๊ธฐํ (์ฒซ ๋ฒ์งธ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ)
16+ 2. ๋ฆฌ์คํธ(ntervals)๋ฅผ ์์์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ
17+ 3. prev_end(์ฒซ ๋ฒ์งธ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ) ๋ณ์ ์ด๊ธฐํ
18184. ๋ ๋ฒ์งธ ๋ฏธํ
๋ถํฐ ์ํํ๋ฉด์:
1919 - ๋ง์ฝ ํ์ฌ ์์์ (๋ฏธํ
์์ ์๊ฐ)์ด ์ด์ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ๋ณด๋ค ์์ผ๋ฉด false ๋ฐํ
2020 - ๊ทธ๋ ์ง ์์ผ๋ฉด prev_end๋ฅผ ํ์ฌ ๋ฏธํ
์ ์ข
๋ฃ ์๊ฐ์ผ๋ก ์
๋ฐ์ดํธ
21215. ๋ชจ๋ ๋ฏธํ
์ ๊ฒ์ฌํ ํ์๋ ์ถฉ๋์ด ์์ผ๋ฉด true ๋ฐํ
22+
23+ ๋ฉ๋ชจ:
24+
25+ ๋ณ์๋ช
ํท๊ฐ๋ฆผ:
26+ - intervals๋ ๋ฆฌ์คํธ -> `.end` ์์ฑ ์์
27+ - interval์ ๊ฐ์ฒด -> `.end` ์์ฑ ์์
28+
29+ ์ ๋ ฌ ๋ฌธ๋ฒ:
30+ - list.sort(key=lambda x: x.start)
2231"""
2332from typing import List
2433
You canโt perform that action at this time.
0 commit comments