Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Assume that in the solution, the selected slot from slotsA is bigger than the respectively selected slot from slotsB.
Use two pointers in order to try all the possible intersections, and check the length.
Do the same in step N° 1 but now assume that the selected slot from slotsB is bigger, return the minimum of the two options.