-
Practice Advanced Slice Operations
Slice exercises for warm-up
-
Limit the backing array sharing
Your package needs to control the slices that it shares with the outside world.
-
A slice retrieved from a package causes a memory leak in your program.
-
Add a newline after each sentence
Use the power of the
copy()
function and add newlines into a new buffer from a string slice. -
Group the web request logs into a multi-dimensional slice. Allocate a slice with the exact size needed by doing some wizardary calculations. And lastly, pretty print the result.