Go zero values and short declarations

F-ZERO-V4-3hard

Count rentals from a zero ledger

The tool-shed register must distinguish unavailable stock from unknown tools, reject a bad import before printing stock, and count rentals without a setup call.

What needs to change

Repair Rent so a zero Ledger counts every rental.

Reproduce

  1. Pipe the sample rentals into go run main.go and compare the three count lines with the expected stdout.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

The file contains its imports, readLines, the Ledger type, Count and the complete main.

Input: one rented tool name per line.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in