Since you haven't provided your code we can just talk in concepts.
I would approach this by using a recurring function along the lines of:
1. Build a list of all the relevant ranges and sort in length order
2. Remove the shortest
3. Repeat steps 1 & 2 until there are no more ranges found.
The important part is after removing the shortest range, you do a complete rebuild of the list
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|