...
The Solution
In the playground below, you will find my solution.
I have written loads of comments to help you ...