TypeScript · easy
Checkout bills one unit per line, even when the order says six. A customer bought 6 licenses and the invoice charged for 1, so cartTotal is ignoring qty.
Calculate each line from its price and quantity, then add the lines together. For (100¢×2) and (50¢×3), return 350; an empty cart returns 0.
workspace/
└── src/
└── cart.ts (qty is decorative)With sharpen installed, this command opens exactly this challenge in your local arena:
sharpen 18
First time? The full install is right below.
npm install -g @juanwmedia/sharpen sharpen 18 npx @juanwmedia/sharpen 18 sharpen update