Spam filter false positives
Your task
A spam filter outputs an integer risk score from 0 to 100 per email, and any email with score >= threshold gets quarantined. Legal wants to know how many legitimate emails would be quarantined at a proposed threshold. Given equal-length lists scores and labels (label 1 = spam, 0 = legitimate) and an integer threshold, return the number of false positives: emails whose label is 0 and whose score is greater than or equal to threshold. Example: scores = [90, 40, 75, 60], labels = [1, 0, 0, 1], threshold = 70 gives 1.
Examples
false_positives_at(scores: list[int], labels: list[int], threshold: int) -> intExample 1
Input
false_positives_at([90, 40, 75, 60], [1, 0, 0, 1], 70)Output
1