Grocery Checkout Coupons with Category Stacking and a Discount Cap
Asked at Palantir · Coding Questions · Difficulty: Medium · Last asked Sep 19, 2026
A grocery chain is piloting checkout coupons, but its point-of-sale system has no discount support. Write the function that takes a shopping cart and a list of coupons and returns the receipt totals: the price before discounts, the total amount saved, and the amount the customer pays. All money is in integer cents, and the result must be exact to the cent.
Loading the problem…