Task Hare
You are given a list of integers tasks and another list of integers people. The integer tasks[i] represents the amount of strength required to perform the ith task. people[i] represents the amount of strength the ith person has.
Return the number of tasks that can be finished if one person can perform at most one task.
Constraints
n ≤ 100,000wherenis the length oftasksm ≤ 100,000wheremis the length ofpeople
https://binarysearch.com/problems/Task-Hare
Examples
Example 1
Input
- tasks =
[3, 2, 9, 13] - people =
[10, 5, 2, 1]
Output
- answer =
3
Explanation
- First person can perform task
9 - Second person can perform task
3 - Third person can perform task
2 - Fourth person can’t perform any tasks
Leave a comment