LearnPy Hub
← Arena
EasyRating 1000

Cookies for Children

Child i is happy with a cookie of size ≥ greed[i]; each child gets at most one cookie. Maximise happy children.

Input

Two lines: greed values, cookie sizes.

Output

A count.

Sample 1

Input
1 2 3
1 1
Output
1

Sample 2

Input
1 2
1 2 3
Output
2
solution.py
Output appears here
Cookies for Children · Python Arena problem · LearnPy Hub