← ALL NOTES
Array

1475. Final Prices With a Special Discount in a Shop

Each item's price drops by the price of the first later item whose price is ≤ it (no discount if none); return the final prices. This is the "next smaller-or-equal element to the right" pattern — a…

Loading…