final-prices-monotone-stack-linear-time

Status: IN

`finalPrices` achieves O(n) time via a monotone stack where each index is pushed and popped at most once.

Source: entries/2026/06/06/final-prices-with-a-special-discount-in-a-shop-solution.md

JSON