Skip to content

Latest commit

 

History

History
55 lines (22 loc) · 782 Bytes

File metadata and controls

55 lines (22 loc) · 782 Bytes

Checkout

Model and implement the checkout from a super market:

Step 1

  • Calculate the overall sum for a checkout
  • You'll receive a list of prices

Step 2

  • An item is identified by a single letter (e.g. "A", "B", …)
  • Each item has a defined price, e.g.
    • A = 30
    • B = 10
  • The order is represented as a string of item identifiers (e.g. "ABBC")
    • Items may occur in arbitrary order

Step 3

  • You should also be able to scan several order strings in a row to combine them
    • e.g. "ABB", then "CB" and the resulting order is "ABBBC"

Step 4

  • There are additional rules that define extraordinary prices, e.g.
    • "Buy two A for 45"
    • "Buy three A and get one for free"

Step 5

  • Rules may change over time
    • e.g. every week