All problems
Donor Pool Size
Problem
Return the number of eligible donor units, max(0, total_units - treated_units - excluded_units). Return 0 when total_units is not positive.
Hint
Remove treated and ineligible units from the pool.
Test cases
case 1
in: [100,20,5]
expected: 75
case 2
in: [10,4,6]
expected: 0
case 3
in: [10,0,0]
expected: 10
case 4
in: [0,1,1]
expected: 0
case 5
in: [50,25,10]
expected: 15
Starter codePython
def donor_pool_size(total_units, treated_units, excluded_units):
# Your code here
pass5 test cases · run your code against them in the editor