Cover the Demands — Solution & Editorial
Sort both; matching the k-th smallest capacity with the k-th smallest demand is optimal (any valid assignment can be un-crossed). Check pairwise ≥.
Complexity: O(N log N)
Sort both; matching the k-th smallest capacity with the k-th smallest demand is optimal (any valid assignment can be un-crossed). Check pairwise ≥.
Complexity: O(N log N)