Ive been trying to figure out how to deal with this problem and im curious if anyone has found a good way to deal with it

I have a number of options assigned to number range and im trying to figure out all the possible unique combination

for example
option a is assigned to widget 1-100
option b is assigned to widget 5-10
option c is assigned to widget 6 and 22
option d is assigned to widget 9-100
...etc

I want to figure out how many unique widgets i have what options all each unique widget has. I cant seem to figure out a good way to build a data structure to deal with this though. Has anyone encountered a similar problem and come up with any good ways to solve it