Created
January 3, 2020 14:35
-
-
Save ShinJJang/baab6c6769157c020396647605f292d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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