You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we use two pointers where i starts from front and j starts from the end after sorting the weights. If the sum of values at the pointers is <=limit then we can send the rocket and if the limit exceeds then we have only one option left that is to send weights[j] single in the rocket and repeat the same procedure.