File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 11"""
22[๋ฌธ์ ํ์ด]
33# Inputs
4+ [(0, 8), (8, 10)] -> ํํ ๋ฐฐ์ด
45
56# Outputs
7+ ๋ชจ๋ ๋ฏธํ
์๊ฐ์ ๋ํด ์ฐธ์ฌํ ์ ์๋์ง์ ๋ํ ์ฌ๋ถ
68
79# Constraints
10+ 0 <= intervals ๋ฐฐ์ด <= 10^4
11+ ๊ตฌ๊ฐ ๊ธธ์ด : 2
12+
813
914# Ideas
15+ ์ ๋ ฌ ํ ๊ฐ ์์ ์ํํ๋ฉด์, ์ฒซ๋ฒ์งธ ์ค๋ฅธ์ชฝ ๊ฐ๋ณด๋ค ๋๋ฒ์งธ ์ผ์ชฝ ๊ฐ์ด ํฌ๊ฑฐ๋ ๊ฐ์ผ๋ฉด ํต๊ณผ
16+ ์๋๋ฉด false?
1017
1118[ํ๊ณ ]
1219
1320"""
1421
1522
23+ class Solution :
24+ """
25+ @param intervals: an array of meeting time intervals
26+ @return: if a person could attend all meetings
27+ """
28+
29+ def can_attend_meetings (self , intervals : List [Interval ]) -> bool :
30+ # Write your code here
31+
32+ intervals .sort (key = lambda x : (x [0 ]))
33+ for i in range (len (intervals ) - 1 ):
34+ if intervals [i ][1 ] > intervals [i + 1 ][0 ]:
35+ return False
36+
37+ return True
38+
39+
40+ # ํด์ค
41+ # ์ ์ถ ์ฝ๋์ ๋์ผ!
42+
43+
You canโt perform that action at this time.
0 commit comments