I’m trying to solve this problem right now, but I’m struggling to understand what the problem is asking.
Define the union of a set of segments to be the set of all x that are contained within at least one segment. Define the complexity of a set of segments to be the number of connected regions represented in its union.
The definition in the problem statement seems pretty unambiguous to me, but if you’re still unsure and you have multiple interpretations that pass the sample input you could always try submitting and seeing if you pass test cases 2-3.