AlgoLounge

Alex's Brew Coffee Shop Billing

easy

Calculate the total cost for coffee shop orders including 15% tax, rounded to the nearest dollar.

Menu Prices:

  • Espresso: $3
  • Latte: $5
  • Croissant: $6

Example

Example 1

Input:  ["Espresso", "Latte", "Croissant"]
Output: 16

($3 + $5 + $6) × 1.15 = $16.10 → $16

Constraints

  • 1 ≤ number of items ≤ 100
  • Items can repeat
  • Round to nearest dollar after tax
TypeScript
Loading editor…
List of test cases (10)
Case 1
items = ["Espresso","Latte","Croissant"]
Case 2
items = ["Espresso"]
Case 3
items = ["Latte","Latte"]
Case 4
items = ["Croissant","Croissant","Croissant"]
Case 5
items = ["Espresso","Espresso","Espresso","Espresso"]
Case 6
items = ["Latte","Croissant"]
Case 7
items = ["Espresso","Latte","Latte","Croissant"]
Case 8
items = ["Croissant"]
Case 9
items = ["Latte"]
Case 10
items = ["Espresso","Espresso","Latte","Latte","Croissant","Croissant"]