Your question is Detecting Vulnerabilities with Scripts. 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.
Tell me about a time you had to write a script to detect vulnerabilities or suspicious activity.
Implement detect_suspicious_activity(events, window_size, threshold). Each event is [timestamp, identity, action], where timestamps are integers and action is either failed_auth or another value. Return the identities with at least threshold failed-authentication events whose timestamps fit within an inclusive window of length window_size. Return identities in lexicographic order.
events is an unsorted list of event records. Return a list of strings.
def detect_suspicious_activity(events, window_size, threshold):