You're given two arrays:
You’re also given:
Write a function that returns an array of integers representing the count of packets with the given target_label in each sliding window of size window_size seconds. The sliding window should move one second at a time, and the counts should reflect how many packets with target_label fall within each window.
Something like the following
timestamps = [2, 4, 5, 8, 10]
labels = ["x", "y", "x", "x", "y"]
target_label = "x"
duration = 3
There was one more follow up along the same lines!