You are viewing a single comment's thread. Return to all comments →
def missingNumbers(arr:list, brr:list): sol = [] arr_frequency = Frequency(arr) brr_frequency = Frequency(brr) for number , freq in brr_frequency.items(): if number not in arr_frequency: sol.append(number) elif number in arr_frequency: if arr_frequency[number] != freq: sol.append(number) return sorted(sol) def Frequency(elements:list): temp = {} for element in elements: if element not in temp: temp[element] = 1 else: temp[element] += 1 return temp
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 →
Time Complexity =