You are viewing a single comment's thread. Return to all comments →
Python
def missingNumbers(arr, brr): arr.sort() brr.sort() ai, bi = 0, 0 res = [] while ai < len(arr) and bi < len(brr): if arr[ai] > brr[bi]: if brr[bi] not in res: res.append(brr[bi]) bi += 1 elif arr[ai] < brr[bi]: ai += 1 else: ai += 1 bi += 1 res += sorted(set(brr[bi:])) return res
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
Python