Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Took me 2 evenings to solve this one and was really hard to get my head around. Suggest searching the web for "python function closure" as your next port of call.
I'm struggling with the format of the output too, even though I get the output values correct. I created two lists of the positions and the peaks, then combined them into a dictionary like this {'pos':positions, 'peaks':peaks}. I also tried iterating through both lists to create a value:pair of each pos:peak, so output was {3:7, 6:3}.