https://www.hackerrank.com/challenges/missing-numbers/problem?isFullScreen=true
def missingNumbers(arr, brr):
for ar in arr:
brr.remove(ar)
brr = sorted(set(brr))
return brr
arr은 brr의 부분 집합이여서 가능하다.
아니였다면 brr에 없는 ar을 제거하지 못해 에러가 나서 수식이 돌아가지 못했을 것이다.
'파이썬 코딩테스트 > 해커랭크' 카테고리의 다른 글
| HackerRank / String Construction / Python (0) | 2021.12.27 |
|---|---|
| HackerRank / The Love-Letter Mystery / Python (0) | 2021.12.26 |
| HackerRank / Smart Number / Python (0) | 2021.12.26 |
| HackerRank / Sherlock and Array / Python (0) | 2021.12.24 |
| HackerRank / Sherlock and Cost / Python (0) | 2021.12.24 |