Very Imp Question Asked in many coding rounds anyone plzzz answer this!

Tony is a boss. He has workers working for him. Each worker has a strength.
While, Tony also has some tasks. Workers will do the task, one worker can do one task only if workers strength is greater than or equal to task requirements.
There is also a magic pill which will increase the strength of worker by B amount.
Output the max tasks can be done.

Test Case :
Number of pill: 2
B : 1

Workers : [2,4]
Tasks : [3,2]

Output : 2

Comments (8)