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.
Notes:
I first saw this in rhr's solution.
which means no final swapping of the indexes and values is needed before passing to PickedPeaks. This doesn't seem to impact performance much, if at all, but it makes for cleaner code. Because record syntax is used in all the tests it still works exactly the same.
If you imagine a set as a bag of things, then a permutation is one possible result of pulling random things out the bag one at a time and putting them in a row until the bag is empty. What you describe are usually called the n-tuples of a set (specifically ones where n is equal the size of the set). There's some more info here: https://en.wikipedia.org/wiki/Permutation#Permutations_with_repetition
It's not, it just converts it from a character to an integer; it seems that cubing a sequence before summing it doesn't change whether the sum will be divisible by 2! Quite a nice observation, and requires less work.
This comment is hidden because it contains spoiler information about the solution