We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc45fe2 commit 537e06dCopy full SHA for 537e06d
1 file changed
live9/test93/문제3/박희경.py
@@ -0,0 +1,10 @@
1
+def solution(routes):
2
+ answer = 0
3
+ camera = float('-inf')
4
+
5
+ routes.sort(key=lambda x: x[1])
6
+ for i in range(len(routes)):
7
+ if routes[i][0] > camera: # 진입 지점이 카메라보다 뒤에 있는 경우 카메라 추가해야 함
8
+ answer += 1
9
+ camera = routes[i][1] # 진출 지점에 카메라 설치
10
+ return answer
0 commit comments