If you assume that 'ranges' are 'sets', the terms 'union' and 'intersection' are well defined. They are both sets. Marshall has given shown how to compute them directly from the definitions. Perhaps your spec intends for you to compare the cardinality of these sets.
If you assume that 'ranges' are ordered lists, you need LanX's assumptions to make any sense at all. (The calculation is much simpler because it exploits the ordering.)
Fortunately, both sets of assumptions produce the same results.
| [reply] |