"""
출처:프로그래머스,
https://school.programmers.co.kr/learn/courses/30/lessons/181188
"""
# 풀이 과정
def solution(targets):
targets.sort(key=lambda x: x[1])
target = 0
count = 0
for x, y in targets:
if target <= x:
count += 1
target = y
return count
Lv2 프로그래머스(Programmers)[Python][파이썬] 요격 시스템
"""
출처:프로그래머스,
https://school.programmers.co.kr/learn/courses/30/lessons/181188
"""
# 풀이 과정
def solution(targets):
targets.sort(key=lambda x: x[1])
target = 0
count = 0
for x, y in targets:
if target <= x:
count += 1
target = y
return count