Final Prices With a Special Discount in a Shop

Problem overview from a real Uber interview:

Uber array problem. Use a monotonic stack to find the first smaller or equal element to the right of each item and subtract it from the current value.

Check more interview questions and experiences about Uber

Please log in to view interview details