
ALT def count_fully_contained_pairs(pairs): # Initialize a counter for the number of fully contained pairs. fully_contained_pairs = 0 # Loop through the pairs of ranges. for pair in pairs: # Split the pair into two separate ranges. range1, range2 = pair.split(",") # Split each range into a start and end value. start1, end1 = map(int, range1.split("-")) start2, end2 = map(int, range2.split("-")) # Check if one range fully contains the other. if (start1 <= start2 <= end1) and (end1 <= end2): fully_contained_pairs += 1 elif (start2 <= start1 <= end2) and (end2 <= end1): fully_contained_pairs += 1 # Return the number of fully contained pairs. return fully_contained_pairs

ALT def count_overlapping_pairs(pairs): # Initialize a counter for the number of overlapping pairs. overlapping_pairs = 0 # Loop through the pairs of ranges. for pair in pairs: # Split the pair into two separate ranges. range1, range2 = pair.split(",") # Split each range into a start and end value. start1, end1 = map(int, range1.split("-")) start2, end2 = map(int, range2.split("-")) # Check if the ranges overlap. if (start1 <= end2) and (start2 <= end1): overlapping_pairs += 1 # Return the number of overlapping pairs. return overlapping_pairs



















