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.
Because 1) one can only assume that the sequence have at least 3 items, any more is not guaranteed (while any less would make no sense) and 2) 3 items give me enough information to know if the sequence has more even or odd items.
The rest of the explanation is above, let me know if you still miss some part of it and I will be glad to explain :)
So, why only the first three numbers? thats where I'm getting tripped up? why not every number? or is this just a limited solution?
My pleasure to help a fellow code-warrior; even more if you took the time to consider and look at my work :)
Yeap that was perfect! thanks guys!;)
Perfectly explained by bkaes-senpai :)
If I were to analyze it myself, I would say that I tried a more creative approach instead of some brute-force method, assuming of course that each sequence had to have at least 3 elements. The first line split and parses the string, turning everything into either 0 (if it is even) or 1 (if it is odd), then the final two see if we are looking for the sole odd or the sole even and act accordingly :)
Let me know if I answered your question properly :)
nice!, could you explain whats going on? Thanks :)!
You could use your sum function to do your average one.