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 really like this one
Cool, thanks!
Click
fork
.Is there a way to bookmark/add to collection a specific solution for a kata, for future reference?
Very inventive. I like the part with multiplying the running total by 10 as you're moving down the number - takes a certain kind of perverted logical thinking to come up with that, but it works!
To explain with an analogy, using an array to do lookups is like looking through an entire library shelf by shelf to find a specific book. Conversely, using a dictionary/hash map is like asking the librarian to locate the book, having her look up its Dewey Decimal number, and directing you to the exact shelf and row the book is on! Much more efficient!
Probably. Nested loops grow extremely fast when the input grows, while flat loops just grow proportionnally.
See:
etc.
I think your question has received an answer :)
Really? if i will have third but not nested loop, will not it time out?
This comment is hidden because it contains spoiler information about the solution
Would be more efficient to save Math.sqrt(num) into a var instead of calculating it every loop iteration, I think.
Also - really liked this little bit at the end: return num > 1;
Clever - allows to not have a separate error check for num<=1
On one hand I agree that it would've made it easy and that it should require effort to solve it.
BUT! Perhaps MENTIONING THAT WE CANNOT USE BIGINT in the kata description would've been most wonderfully, awesomely, magnificently excellent and logical, no?!
So people wouldn't wrack their brains wondering why the hell "BigInt is not defined" and wasting time trying to solve the issue, - instead of concentrating on solving the actual problem?
Goddammit, this is so frustrating.
Nice and simple, I like.
OMG PWN3D!
Just wanna say how much I liked the vars update without using a temp var. Elegant!
Loading more items...