Closures and captured variables

F-CLOSURE-V4-3hard

Give each reminder its own name

A front desk counts each visitor’s visits, quotes prices that can change later and schedules reminders.

What needs to change

Repair the loop in main so every deferred reminder retains its original scheduled position and name.

Reproduce

  1. Use go run on the three-name sample and compare every line with the expected stdout.

Acceptance criteria

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

Notes

The starter supplies reminderData with position/name fields and a pointer to one reusable record. Callbacks run after the batch is queued.

Input: one name per line.

Names are valid non-empty input words. Batches and visit counts fit the supplied small numeric ranges.

Sign in to open this exercise

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

Sign in