Problem
Child i is happy with any cookie of size at least g[i]. Cookie j has size s[j]. Each child gets at most one cookie and each cookie goes to at most one child. Return the maximum number of happy children.
Example 1
- Input
- g = [1, 2, 3], s = [1, 1]
- Output
- 1
Example 2
- Input
- g = [1, 2], s = [1, 2, 3]
- Output
- 2
Example 3
- Input
- g = [5], s = []
- Output
- 0
Constraints
1 <= g.length <= 3 * 10^40 <= s.length <= 3 * 10^41 <= g[i], s[j] <= 2^31 - 1