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.
I am really not sure about this. Inputs go slightly above 1M, and determining whether a number of magniture 1M is prime is not that expensive, or difficult. Some optimization techniques are to be expected for a 5 kyu kata, but this kata requires only very basic ones, nothing really fancy.
how on earth is this an issue
The optimisation requirement feels steep, especially for a 5 kyu problem.
My code completes a test case in ~0.5s with a relatively efficient solution.
More readable than the other "one-liner" solutions (I know it's multiple lines but it's one statement, ykwim)
I have to wonder though... ' ' * 3 is more effort to type that ' ' lol, what's the deal with that?
+1
lmao
Eh, agree to disagree. Wouldn't call it "hacky", it's just not very neat. I'd personally find it easier to read a multiline solution
I've seen hacky code before - this isn't hacky in the least. If anything, it's the most idiomatic way to do this, imo.
Who voted best practises lmao? If I saw this in a codebase I'd cry
Still, outside of production, I love clever one liners - +1.
so clean !
Turing would be proud