Concurrency48 of 62
The starter code launches n goroutines, each with its own i, and waits for all of them with a sync.WaitGroup. Inside the goroutine, store (i+1) * (i+1) into results[i] — each goroutine only ever touches its own slot, so there's nothing to synchronize beyond the WaitGroup itself. Print results once every goroutine is done.
Sign in to try this exercise.