Your question is Write a Data Manipulation Function. 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.
Prometheus Laboratories receives alert IDs from multiple monitoring surfaces. Given a sequence of alert IDs and a minimum frequency, return every alert ID that appears at least that many times, preserving the order in which qualifying IDs first appeared.
Each occurrence contributes to the total count, and duplicate IDs must appear only once in the result.
Implement filter_alerts(alert_ids, minimum_frequency). The parameter alert_ids is a list of strings, and minimum_frequency is a positive integer. Return a list of strings containing exactly the IDs whose total occurrence count is at least minimum_frequency, ordered by their first appearance in alert_ids.
def filter_alerts(alert_ids, minimum_frequency):