Minimum Number of Taps to Open to Water a Garden
Clip each tap’s watered span to the garden, then greedily open the tap that reaches farthest among those starting at or before the covered point.
Clip each tap’s watered span to the garden, then greedily open the tap that reaches farthest among those starting at or before the covered point.