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.
Awesome fu here, thanks. Especially fusing the array traversals and the shift.
It's a bit cryptic though, always the same problem :).
This comment is hidden because it contains spoiler information about the solution
Hi! I wonder if
rustc
optimizes the two traversals into a single traversal? Does anybody know?This is one of the best katas I have ever completed! Thanks!
This comment is hidden because it contains spoiler information about the solution
For Rust, when clicking "Attempt", this kata only compiles when the import statement
use std::str::FromStr;
is added. At first, I did not useFromStr
and passed the "Test" step, but could not run "Attempt". Further, the visible tests have the expected solution on the LEFT while the hidden tests have the expected solution on the RIGHT. This confused me during debugging.You may have commented another version of this solution, but I do not see how primes are recomputed. First, the upper bound is computed, then all primes until the upper bound.
Nice solution, thanks!
That should also work. A rule could be that literals should always be on the left hand side (if the operator is commutative).
I agree. I also get:
And so on.
I really enjoyed this kata in the beginning, but with all these corner cases, it became a bit of a hazzle. Nice idea though, thank you!
No, it is not needed.
This is smart but extremely slow!