Report each basket
The first helper must return the original record with the highest quoted price; the callback tells it how to read a price without assuming a particular product shape. The first-value helper feeds a price-series report where an empty series means none and a genuine first price of 0 remains 0. The average helper formats integral quantity observations to two decimal places, including their fractional mean.
What needs to change
Repair First and describe so every basket’s report is right, including baskets with no prices.
Reproduce
- Pipe the sample baskets into go run main.go and compare each first line.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
The file contains its imports, readLines, the noPrice text and the complete main.
Input: up to 100 whitespace-delimited baskets: a day followed by zero to 100 decimal whole-number prices from 0 to 300. Leading zeros are allowed. The supplied reader receives valid data.