Function to return the updated frequency map for the array passed as argument
def getFrequencyMap ( arr , n ) : NEW_LINE INDENT hashMap = defaultdict ( lambda : 0 ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT hashMap [ arr [ i ] ] += 1 NEW_LINE DEDENT return hashMap NEW_LINE DEDENT