Counting freq of each element
if arr [ i ] in mpp : NEW_LINE INDENT mpp [ arr [ i ] ] = mpp [ arr [ i ] ] + 1 NEW_LINE DEDENT else : NEW_LINE INDENT mpp [ arr [ i ] ] = 1 NEW_LINE DEDENT ans = 0 NEW_LINE for key in mpp : NEW_LINE value = key NEW_LINE freq = mpp [ key ] NEW_LINE