Skip to content

Instantly share code, notes, and snippets.

@ShinJJang
Created January 3, 2020 14:35
Show Gist options
  • Save ShinJJang/baab6c6769157c020396647605f292d2 to your computer and use it in GitHub Desktop.
Save ShinJJang/baab6c6769157c020396647605f292d2 to your computer and use it in GitHub Desktop.
def solution(participant, completion):
answer = ''
count_dict = {}
for p in participant:
count_dict[p] = count_dict.get(p, 0) + 1
for c in completion:
count_dict[c] = count_dict.get(c, 0) - 1
if count_dict[c] == 0:
del count_dict[c]
answer = list(count_dict.keys())
return answer[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment