Minimum box packing
Your task
A warehouse packs orders into boxes. Each box size holds an exact number of items, for example sizes [4, 6], and every box you use must be completely full. You have unlimited boxes of each listed size (all distinct positive capacities). Given the sizes and a total item count, return the minimum number of boxes that pack all items exactly, or -1 if no exact packing exists. Zero items need 0 boxes. For example, sizes [4, 6] with 14 items pack as 4+4+6 using 3 boxes.
Examples
min_full_boxes(sizes: list[int], items: int) -> intExample 1
Input
min_full_boxes([4, 6], 14)Output
3Example 2
Input
min_full_boxes([4, 6], 7)Output
-1