Child i is happy with a cookie of size at least greed[i]. Cookie j has size sizes[j]. Each child gets at most one cookie and each cookie goes to at most one child. Return the largest number of happy children.
For greed = [1, 2, 3] and sizes = [1, 1] the answer is 1.
Example 1
Input:
assign_cookies([1, 2, 3], [1, 1])
Output:
1
Example 2
Input:
assign_cookies([1, 2], [1, 2, 3])
Output:
2
0 <= len(greed), len(sizes) <= 2000001 <= greed[i], sizes[j] <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.