Grocery List Generator — illustrative example INPUT Two recipes need 2 onions and 3 onions; pantry has 1 usable onion. One recipe also needs 500 g potatoes. RESULT Buy 4 onions and 500 g potatoes. Calculation: 2 + 3 − 1 = 4 onions. Keep variety or preparation requirements separate when the recipes specify them. REVIEW A grocery list should consolidate matching ingredients without mixing incompatible units or forms. Subtract pantry stock only when the user confirms it is usable and intended for the plan. This is a teaching example, not a live execution record.