Minimum box packing

Write codeMedium15 minGoogle and Amazon style

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) -> int
Example 1
Inputmin_full_boxes([4, 6], 14)
Output3
Example 2
Inputmin_full_boxes([4, 6], 7)
Output-1