I have this list:
mylist = [20, 30, 25, 20, 30]
After getting the duplicated values indexes using
[i for i, x in enumerate(mylist) if mylist.count(x) > 1]
the result is:
`[0, 1, 3, 4]`
having two pairs of duplicated values. I’d like to know, how can i get only the higher duplicated value? In this list it is 30 or any of it’s indexes, 1 or 4, instead of the whole list of duplicated values.
Regards…
This one is O(n)