You have parcels with sizes parcels[i] and boxes with capacities boxes[j]. A parcel fits into a box when capacity >= size. Every box holds at most one parcel and every parcel goes into at most one box.
Return the maximum number of parcels that can be shipped.
Examples
Input: parcels = [4, 7, 2], boxes = [3, 5, 1]
Output: 2
Explanation: The capacity-1 box is too small for every parcel; boxes 3 and 5 take parcels 2 and 4.
Input: parcels = [6, 3], boxes = [8, 3, 4]
Output: 2
Constraints
0 <= len(parcels), len(boxes) <= 10**51 <= parcels[i], boxes[j] <= 10**9- Target complexity: O(n log n + m log m).
Goals
- Sort both lists and match them with two pointers
- Argue why the smallest box that fits should take the smallest parcel
- Handle the case where one list runs out first