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 1
1
"""
2
2
[๋ฌธ์ ํ์ด]
3
3
# Inputs
4
+ [(0, 8), (8, 10)] -> ํํ ๋ฐฐ์ด
4
5
5
6
# Outputs
7
+ ๋ชจ๋ ๋ฏธํ
์๊ฐ์ ๋ํด ์ฐธ์ฌํ ์ ์๋์ง์ ๋ํ ์ฌ๋ถ
6
8
7
9
# Constraints
10
+ 0 <= intervals ๋ฐฐ์ด <= 10^4
11
+ ๊ตฌ๊ฐ ๊ธธ์ด : 2
12
+
8
13
9
14
# Ideas
15
+ ์ ๋ ฌ ํ ๊ฐ ์์ ์ํํ๋ฉด์, ์ฒซ๋ฒ์งธ ์ค๋ฅธ์ชฝ ๊ฐ๋ณด๋ค ๋๋ฒ์งธ ์ผ์ชฝ ๊ฐ์ด ํฌ๊ฑฐ๋ ๊ฐ์ผ๋ฉด ํต๊ณผ
16
+ ์๋๋ฉด false?
10
17
11
18
[ํ๊ณ ]
12
19
13
20
"""
14
21
15
22
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