Your question is Minimum Alert Window Coverage. 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 alert codes alerts and a list of required alert codes required, return the shortest contiguous subarray of alerts that contains every code from required with at least the same frequency. If no such subarray exists, return an empty list. The function should return the subarray values, not the indices.
def min_alert_window(alerts, required):