sort the weights in increasing order.
keep on counting the number of gondolas required as the array is traversed. If the gondola can’t hold a person, update the gondola weight, and increase the gondola count.
Still, the correct answer is not coming, I tried many ways to debug my code but couldn’t find what is wrong in my approach.
Pls, help me.
got it thanks !. So the intuition behind this approach was to put 1 small and 1 big guy into a gandola, i mean pick form 2 extremes if we can, that way min gandolas could be used ?