https://github.com/zoltan-nz/code-challenges-playground
https://github.com/zoltan-nz/code-challenges-playground
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/zoltan-nz/code-challenges-playground
- Owner: zoltan-nz
- Created: 2019-11-03T12:46:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:28:05.000Z (almost 3 years ago)
- Last Synced: 2025-03-30T13:03:41.246Z (6 months ago)
- Size: 1.26 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discount Calculator
```json
{
"customer-1": [
{ "product": "bred", "quantity": 28 },
{ "product": "chocolate", "quantity": 18 },
{ "product": "cake", "quantity": 7 }
]
}
```Discount distribution
| Quantity Range | Discount Rate |
| -------------- | ------------- |
| 0-35 | 0% |
| 36-50 | 5% |
| 51- | 10% |Expected allocation
```json
{
"customer-1": [
["bred", "10%", 3],
["bred", "5%", 15],
["bred", "0%", 10],
["chocolate", "0%", 18],
["cake", "0%", 7]
]
}
```