Count each room once
A hotel bill applies room discounts, accepts coupons and counts the rooms booked.
What needs to change
Repair distinctRooms so each room is counted once.
Reproduce
- Pipe the sample bookings into go run main.go and compare the rooms line.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
The file contains its imports, readLines, the Booking type and the complete main.
Input: up to 100 whitespace-delimited "room price" bookings. Room IDs are decimal numbers from 0 to 9999 and prices from 0 to 100, with leading zeros allowed. Repeated numeric IDs denote one room; every booking contributes revenue. The supplied reader receives valid fields.