Algorithm · Amazon · Medium
You are handed a log of IP headers in which every record holds a single IPv4 address. Implement most_frequent_ips(n, ips), where ips is the list of n recorded addresses, and identify which addresses show up most often. Report the ten addresses with the highest counts. When further addresses share the same count as the address in tenth place, they must be included as well. Addresses that occur the same number of times belong to a single group, and the addresses inside each…