Your question is Detect Anomalous IP Request Bursts. 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 logs, a set of target IP addresses target_ips, an integer window size window_seconds, and an integer threshold max_requests, write a function that parses the logs, counts requests for the target IPs, and returns the IPs that have any time window of length window_seconds containing more than max_requests requests. Each valid log line has the format "<timestamp> <ip>", where timestamp is an integer number of seconds.
def detect_anomalous_ips(logs, target_ips, window_seconds, max_requests):