---
title: "Discussion on \"1475. Final Prices With a Special Discount in a Shop (Easy)\" | Hashnode"
description: "Discussion on \"1475. Final Prices With a Special Discount in a Shop (Easy)\". // next smaller number - monotonic stack\nclass Solution {\npublic:\n    vector<int> finalPrices(vector<int>& prices) {\n    int n = prices.size();\n    std::vector<int> ans(n);\n    std::stack<int> s;\n\n    for(int i = 0; i < prices.size(); i++)\n    {\n    ..."
url: "https://hashnode.com/posts/1475-final-prices-with-a-special-discount-in-a-shop-easy/6652ffc776210d9b5a6b6109"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [1475\. Final Prices With a Special Discount in a Shop (Easy)](https://ashirmehmood.hashnode.dev/1475-final-prices-with-a-special-discount-in-a-shop-easy?utm_source=hashnode&utm_medium=feed)

// next smaller number - monotonic stack class Solution { public: vector<int> finalPrices(vector<int>& prices) { int n = prices.size(); std::vector<int> ans(n); std::stack<int> s; for(int i = 0; i < prices.size(); i++) { ...

May 26, 2024 · 1 min read · ashirmehmood.hashnode.dev  
Read the article

## Written by

[Ashir](https://hashnode.com/@AshirMehmood)

@AshirMehmood

  
[View profile](https://hashnode.com/@AshirMehmood)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
