#3492

Maximum Containers on a Ship

newbie · 245 · lc easy +18 · 75.2% accepted · 64 likes · top 86%

Description

A ship has an n x n deck where each cell fits exactly one container of weight w. The total loaded weight cannot exceed maxWeight.

Return the maximum number of containers that can be placed on the deck.

Code

1
2
3