Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Can we use sorting here?
Sort the ranges and merge the overlapping ranges. Then count number of non-overlapping ranges.
How many ways can we group these non-overlapping ranges?