Check Point partner expenses qualify for different commission rates during defined date ranges. Given two encoded strings, calculate the total commission for all expenses that fall within a commission period.
The dates string contains semicolon-separated commission periods. Each period uses the format start|end|rate_bps, where dates are ISO strings, both boundaries are inclusive, and rate_bps is the commission rate in basis points. The expenses string contains semicolon-separated records in the format date|amount_cents.
Return the total commission as an integer number of cents. Ignore expenses that do not fall within any period. Commission for one expense is calculated as amount_cents * rate_bps // 10000. Commission periods do not overlap, but they may appear in any order.
Implement calculate_commission(dates, expenses).
dates is a string, or an empty string when there are no periods.expenses is a string, or an empty string when there are no expenses.YYYY-MM-DD.def calculate_commission(dates, expenses):