Algorithm · Gusto · Medium
Write calculateProgressiveTax(income, upperBounds, ratesBps), which returns the integer tax owed under a set of progressive (marginal) tax brackets. income is a non-negative integer expressed in minor currency units (for example, cents). ratesBps lists the marginal rate of each bracket in basis points, where 10,000 basis points equals 100%. upperBounds gives the exclusive upper edge of every bracket other than the last one, which has no upper limit. Writing m for the length…