given an array H, where H[i] represent time to build ith car, two factories with total working time of x and y hours, tell maximum no of cars can be produced by both factories.
note: you can NOT build a car partially in a factory and transfer it to other and then build there.
example H={5,5,4,3} x=8, y=9 answer =4, factory 1 can produce car with 5 and 3, factory 2 can produce 5 and 4
H={2,3,1,2,6,5,4}; int x=8,y=9; answer =6
constrains: size of array<1000, x<500, y<500, h[i] <1000