https://programmers.co.kr/learn/courses/30/lessons/42862
1단계인데도 어쩐지 가뿐히 풀리지 않았던 문제
[방법]
[코드]
def solution(n, lost, reserve):
lost.sort()
reserve.sort()
answer = n - len(lost)
temp = lost[:]
for i in temp :
if i in reserve :
answer += 1
reserve.remove(i)
lost.remove(i)
for i in lost :
if i-1 in reserve :
answer += 1
reserve.remove(i-1)
elif i+1 in reserve :
answer += 1
reserve.remove(i+1)
return answer