코드
def solution(n, lost, reserve):
reserve_new = set(reserve) - set(lost)
lost_new = set(lost) - set(reserve)
for r in reserve_new:
front = r - 1
back = r + 1
if front in lost_new:
lost_new.remove(front)
elif back in lost_new:
lost_new.remove(back)
return n - len(lost_new)