AlgoMaster Logo

Final Prices With a Special Discount in a Shop

prices=[8, 4, 6, 2, 3]
0 / 14
algomaster.io
Step:Brute force: for each item, scan right for the first price <= it.