Past week, i was asked this problem in an interview, i don't know the solution till now, help me with this.
Problem
There are $$$N$$$ people in a group, weight of $$$i$$$ 'th person is $$$W[i]$$$, there is a lift of capacity $$$C$$$ which is the maximum weight the lift can carry, everyone wants to go to the top floor via lift.
Determine $$$M$$$, where $$$M$$$ is the minimum times lift must be used by the group so that everyone is able to go to the top floor.
Constraints
Not sure about constraints, please give the best solution you can.
Test Case
$$$N$$$ = 4 $$$C$$$ = 90 $$$W$$$ = [10, 20, 70, 80]
$$$ANS$$$ = 2