Available question text
Tokenize the sentence by spaces and for each word that exactly matches a dollar sign followed by digits, compute price * (100 - discount) / 100 and replace it with a string formatted as "$" followed by exactly two decimal places; leave other words unchanged. Key points are correctly detecting valid price tokens (no extra characters), handling up to 10-digit prices and discounts 0–100, and precise two-decimal formatting.
Related questions
Continue with questions that share topics or the same question type.
- Apply Discount Every n Orders
Coding
- Final Prices With a Special Discount in a Shop
Coding · Array · Monotonic Stack · Stack
- Apply Bitwise Operations to Make Strings Equal
Coding
- Apply bitwise tricks for performance
Coding · Bit Manipulation
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Amazon
Leetcode 2288. Apply Discount to Prices
Reported Sep 29, 2026 · 1 source report
STAFF
Source snapshot: Nov 12, 2026
View source