You are viewing a single comment's thread. Return to all comments →
def equalizeArray(arr:list): lenght = len(arr) frequency = {} for num in arr: if num not in frequency: frequency[num] = 1 else: frequency[num] += 1 return abs(max(frequency.values()) - lenght)
Seems like cookies are disabled on this browser, please enable them to open this website
Equalize the Array
You are viewing a single comment's thread. Return to all comments →
Time Complexity: