Group PolyCurve if is inside another

So I have a bunch of polycurves, how do I group this curve if one is inside another?
These curves represents the perimeter of floors, and I have a feel of opening in those floors.


Like this one in the image, I have a big curve with a small curve inside, I’d like to put it into lists, if one curve is alone the list will have only one item.

Thanks!

Have you tried group curves from archilab, could probably help