← 返回 amazon 的题目列表Design and Retrieve Items in a Nested Box
类型:online_judge
Design a shopping box system with a nested structure, where each box can contain various items (e.g., toothbrush) or other boxes. Implement a function to return all concrete items inside a given shopping box.
Example
Input
{"boxes": [{"name": "box1", "items": ["toothbrush"]}, {"name": "box2", "items": ["box1", "soap"]}]