Anishluke92 / RubySolution

Problem solving using Ruby programming language
0 stars 1 forks source link

Coastal town of Codeville #65

Open danielpaul opened 3 years ago

danielpaul commented 3 years ago

This problem was asked by Glassdoor.

An imminent hurricane threatens the coastal town of Codeville. If at most two people can fit in a rescue boat, and the maximum weight limit for a given boat is k, determine how many boats will be needed to save everyone.

For example, given a population with weights [100, 200, 150, 80] and a boat limit of 200, the smallest number of boats required will be three.