Early stopping rule
Your task
Your team runs a simple sequential rule for calling growth experiments early. Both arms get equal traffic every day. Given control_daily and variant_daily, equal-length lists of daily conversion counts, and integers lead and min_days, find the first day d (1-based) on which BOTH conditions hold: d >= min_days, and the cumulative variant conversions through day d exceed the cumulative control conversions through day d by at least lead. Return that day number, or -1 if no day qualifies. Example: control_daily = [10, 12, 11], variant_daily = [14, 15, 16], lead = 10, min_days = 2 returns 3 (cumulative lead reaches 12).
Examples
first_significant_day(control_daily: list[int], variant_daily: list[int], lead: int, min_days: int) -> intExample 1
Input
first_significant_day([10, 12, 11], [14, 15, 16], 10, 2)Output
3