Towel satisfaction

Write codeEasy12 min

Your task

A gym hands out towels at the front desk. requests[i] is the minimum towel size member i will accept, and towels[j] is the size of towel j. Each member receives at most one towel and each towel goes to at most one member; a member is satisfied only when their towel is at least their requested size. Return the maximum number of satisfied members. Example: requests [1, 2, 3] with towels [1, 1] satisfies 1 member.

Examples

max_satisfied(requests: list[int], towels: list[int]) -> int
Example 1
Inputmax_satisfied([1, 2, 3], [1, 1])
Output1