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.
done
For this kata, a fixed list with 3 elements is better (in my opinion).
3 separate arguments would be acceptable for a new beta kata but I don't think this kata should be updated and existing solutions invalidated.
I decided through string slices and sorting, the complexity of the algorithm is O(n), the task itself is not difficult, you just need to understand what they want from you and how to implement it, it was very interesting, thank you!
That depends on the situation, though? There are times when a list will make sense (for example you want to handle those elements as a group), and where a 10-ary function makes more sense (where you don't want to do that - usually when the first thing the majority of solvers do is destructure them out of the list and into separate values).
We also aren't talking about your hypothetical strawman kata, we're talking about this one.
Enabled in this fork
Enabled in this fork
Enabled in this fork
Enabled in this fork
My question was about a hypothetical kata where the input is a fixed list with 10 elements. Would you suggest to replace that fixed list with 10 separate arguments?
It's literally a tribonacci kata, though? The list is specified to always be of length three, if it had 10 elements then it would be out of spec (and would make a lot of top voted and even reference/author solutions across languages either crash or do undefined behaviour).
If it was the n-bonacci kata then sure, provide
[int]
, but it isnt.Kata retired.
For me
[int] -> int -> [int]
is simpler. I could acceptint -> int -> int -> ...
but notint * int * int -> ...
because there is no uniform support of tuples for existing languages. My problem withint -> int -> int -> ...
is that it is not better than[int] -> ...
for this kata. If the input were a list with 10 elements, would it still be an option to replace this list with 10 separate parameters? I don't see a big difference between 10 elements and 3 elements.I wouldn't say it doesn't affect anyone. Top solutions would disappear from the board. Seeing your top solution disappear, could have an impact on some, not so much on others.
Why does invalidating solutions matter though? It doesn't affect anyone, and it's an extremely easy kata so new ones will fill it up fast anyway.
In my opinion, this issue isn't big enough to invalidate thousands of existing solutions in different programming languages. It's a fair point for new challenges, though.
Loading more items...