Assign Cookies
Easy
Arrays
Array
Greedy
Sorting
Given greed factors g[] and cookie sizes s[], maximize content children.
Constraints
1 ≤ len ≤ 3×10^4
Examples
Example 1:
Input: 1 2 3
1 1
Output: 1
Example 2:
Input: 1 2
1 2 3
Output: 2
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console