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
▲ Console
📱

Install Talent Enrich

Get instant access to jobs and career tools on your device.