1
# Runtime: 75 ms (Top 95.72%) | Memory: 13.9 MB (Top 34.37%)5
def calculateTax(self, brackets: List[List[int]], income: int) -> float:7
if brackets[0][0] < income:8
taxtot += brackets[0][0] * (brackets[0][1])9
income -= brackets[0][0]11
taxtot += income * (brackets[0][1])14
while income > 0 and i < len(brackets):15
if income > (brackets[i][0] - brackets[i - 1][0]):16
taxtot += (brackets[i][0] - brackets[i - 1][0]) * brackets[i][1]17
income -= brackets[i][0] - brackets[i - 1][0]19
taxtot += income * brackets[i][1]