Skip to content

Commit 537e06d

Browse files
committed
93차 3번 문제 풀이(참고)
1 parent bc45fe2 commit 537e06d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

live9/test93/문제3/박희경.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)