All problems
Sequential Stopping
Problem
Find the first look where the absolute z-score exceeds its threshold; return that index, or -1 if the test never stops.
Hint
Sequential tests stop as soon as evidence crosses an interim boundary.
Test cases
case 1
in: [[1,2.5,3],[2,2.2,2.8]]
expected: 1
case 2
in: [[1,1],[1.5,1.5]]
expected: -1
case 3
in: [[-3],[2]]
expected: 0
case 4
in: [[],[]]
expected: -1
Starter codePython
def sequential_stopping(z_scores, thresholds):
# Your code here
pass4 test cases · run your code against them in the editor