Charge sessions by block
Your task
A media platform meters playback in whole aligned blocks of block seconds counted from launch, so the block holding second t is numbered t divided by block, rounded down. Session i plays from starts[i] up to but not including ends[i], both non negative second counts, and is charged for every block it touches even when it touches only a sliver of one. A session whose bounds match touches nothing. Charged separately, the bill totals every session's touched blocks. Folded onto one connection, a block touched by two or more sessions is charged a single time. Sessions arrive unsorted, second counts reach 10^9 and block is at least 1, so walking blocks one at a time is hopeless. Return how many blocks folding would save.
Examples
saved_billing_blocks(starts: list[int], ends: list[int], block: int) -> intExample 1
Input
saved_billing_blocks([0, 90], [100, 150], 60)Output
1Example 2
Input
saved_billing_blocks([5, 50], [10, 55], 60)Output
1Example 3
Input
saved_billing_blocks([0, 60], [60, 120], 60)Output
0