Your question is Count Repeated IP Addresses. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a list of log lines as strings, return the IP address that appears most often. Each valid line starts with an IPv4 address followed by a space and the rest of the message. Ignore malformed lines that do not start with a valid IPv4 address. If multiple IPs have the same highest count, return the lexicographically smallest one. If no valid IP exists, return an empty string.
def most_frequent_ip(logs):