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.
generic, works for lists and for strings (and probably iterables in general)
nice radix conversion from int to string
counting matches of '1' is simple, and could easily scale to higher radixes such as octal
could easily be extended to match multiple digits, such as .count('137')
range traversal is clear
accumulator function sum() over a list is also a nice aggregate function
likely to use a machine instruction underneath; prefer this over the current top solution
Thanks for your suggestion, I agree. However, it would have to be implemented in 3 languages now, and that seems too much of a hassle for a tiny added value.
This comment is hidden because it contains spoiler information about the solution