Search⌘ K
AI Features

Boats to Save People

Explore how to solve the problem of evacuating people with a limited weight capacity per boat. Learn to apply greedy algorithm strategies to pair individuals efficiently, minimizing the number of boats needed. This lesson develops your ability to implement two-pointer techniques and optimize solutions for weight constraints.

Statement

A big ship with numerous passengers is sinking, and there is a need to evacuate these people with the minimum number of life-saving boats. Each boat can carry, at most, two persons however, the weight of the people cannot exceed the ...