Build regression detection
Your task
A release engineer holds a chronological history of nightly builds. builds carries each build's label in the order it ran, and passed carries the parallel verdict of the smoke suite, true when that build was clean. A regression landed once and was never reverted, so passed is monotone: every clean verdict comes before every failing one, and the history never goes back to clean. The team wants to know which build introduced it. Given builds and passed, return the label of the earliest failing build. Return an empty string when every build in the history was clean, and an empty string for an empty history. The two lists are always the same length. Reproducing a verdict costs a full suite run, so the team wants a bisect that consults a handful of them rather than every one.
Examples
first_failing_build(builds: list[str], passed: list[bool]) -> strfirst_failing_build(["nightly-101", "nightly-102", "nightly-103", "nightly-104"], [True, True, False, False])"nightly-103"first_failing_build(["nightly-201", "nightly-202"], [True, True])""first_failing_build(["nightly-301"], [False])"nightly-301"