Changes:

  1. Calculate the cost of special items through one function
  2. Add multiple dictionaries to make the data easy to expand. When the number of products increases (or increase promotion conditions, limit the max number of more products), only need to add data to the corresponding dictionary without changing the function
  3. The naming is simple and easy to understand, increasing code readability
  4. Optimized code logic, more concise