Goldman Sachs | Phone | Most frequent IP address from the logs
Anonymous User
9717

Given a list of logs with IP addresses in the following format.
lines = ["10.0.0.1 - GET 2020-08-24", "10.0.0.1 - GET 2020-08-24", "10.0.0.2 - GET 2020-08-20"]

Return the most frequent IP address from the logs. The retuned IP address value must be in a string format. If multiple IP addresses have the count equal to max count, then return the address as a comma-separated string with IP addresses in sorted order.

What is the optimal solution for this?

Comments (16)