Google | on site | find array of integer is fit to the other
Anonymous User
2227

Given two arrays a,b with positive integers
the item i in a represents a server which has a[i] cores.
the item i in b represents a tasks that needs b[i] cores in order to be execute.
single server can run multiple tasks but single task can only be execte in single server.

return true if servers can run the tasks and false otherwise.

examples:

a = [2,4] b = [1,1,4]
1,1->2
4-> 4
result = true
a = [1,3] b = [2,2]
result = false
a = [8,10] b = [2,3,3,3,7]
2,3,3->8
3,7 -> 10
result = true
Comments (12)