Filter numeric measurements and find a stopping point. Inputs are lists of integers; no type checks are required.

Prototype: count_positive(values) returns the number of values strictly greater than zero. Empty input returns 0.

Final: first_total_at_least(values, target) adds values from left to right. After each addition, if the running total is at least target, return that item's zero-based index. Return None if no addition reaches the target. Empty input always returns None, even for target 0. Negative values and negative targets are allowed. Examples: ([2, 3, 1], 5) -> 1, ([2, -4, 7], 5) -> 2, ([0], 0) -> 0. Do not mutate the input. Stop at the first qualifying prefix; linear work in the worst case.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.