Longest active streak
Your task
A coach reviews a runner’s daily step counts and wants the longest streak of consecutive days that stays "active", tolerating a few off-days: a stretch qualifies if at most k of its days fall strictly below the threshold t. Given steps, t, and k (k >= 0), return the length of the longest qualifying stretch. Example: steps = [12000, 4000, 13000, 11000, 3000, 2000, 14000], t = 10000, k = 1 gives 4 (days 0 through 3).
Examples
longest_active_stretch(steps: list[int], t: int, k: int) -> intExample 1
Input
longest_active_stretch([12000, 4000, 13000, 11000, 3000, 2000, 14000], 10000, 1)Output
4