Available question text
Given a list of chocolate bag sizes (each size may be used any number of times) and a target capacity n, find all unique combinations of bags whose sizes sum exactly to n. For example, given bag sizes [200, 100, 300] and target 500, return all combinations such as [200, 200, 100], [200, 300], [100, 100, 300], [100, 100, 100, 100, 100], etc. The core challenge is a backtracking/DFS search with deduplication to enumerate all valid combinations without permutation duplicates.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Apple
Find All Combinations of Bag Sizes That Sum to a Target Capacity
Reported Jun 2, 2026 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source