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.
Having some experience commiting to back-end and middle-end of certain popular programming language compilers - it's not always so simple. The length of the code doesn't necessarily map to the length of machine code. It's a good rule of thumb, but it might not apply in this case.
These loops are idiomatic and easy to identify by SSA optimization rules.
There's a comment somewhere here that says it's the fastest solution. I haven't really built it with that in mind, but if it is, I bet it's because it's easy for the runtime/compiler to apply optimizations and vectorize the loops.
Just looking at them they seem ripe for some optimized SIMD bit magic implementation.
I don't think it's over documented, although certainly it could be shorter.
That can also imply less perf
point is the length test shouldn't be on the passed string, but on the final hash-tagged string.
This is so cool.
What about joining with gibberish characters?
Nice simple for loop. Less debatable than my reduce function.
Why? You are reducing to a single number according to the data ops. The only time there is no operation on that number is for operation
o
, which just pushes the number to the main function's output array. Seems pretty straightforward.I've done it a bit differently in that my reduce function builds the main output array but I like this top solution, focusing on the number itself.
This comment is hidden because it contains spoiler information about the solution
Make sure to run a Minifier on this code to decrease the amount of characters. It will be more readable.
It can be way longer than 139 characters. Remember that the spaces are not going on the hashtag. Something like this
"a" + " ".repeat(200) + "b"
should be valid.I think it's over-documented. To me it's simpler to make the code shorter (reasonably), thus more readable by itself.
Looping does not need to go through the end. It can stop much sooner if both even/odd arrays have at least 3 values, and each of them has at least 1 value.
Instructions say that the arrays can be huge. Which means we probably should worry about it.
A proper, performant solution is still readable for this problem.
This comment is hidden because it contains spoiler information about the solution
You could do
return divisibleX && divisibleY
only, itll return true if true and false otherwise by itselfLoading more items...