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.
don't need to initialize a new variable (i) u can use n directly
Didn't know this. Thanks!
"arr should be const; (maybe the code was too old and that was not well established back in the day)"
I'm new to this, why should it be const? Should all arrarys be declared with const?
it is not.. in javascript, anything divided by zero equals to infinity..
so infinity will always be greater than 2
Unless of course, it is negative infinity haha..
in that case negative infinity will always be lesser than 2
And also, if you got 0 dragons to kill and 0 bullets to use
in javascript, 0 divided by 0 will be NaN
Well.. the story clearly says there will be dragons and as a hero you should always bring a weapon if you're gonna kill that dragon..
so negative bullets is highly unlikely
also, 0 dragons and 0 bullets
But you got a point! HEHE
yes, it is just the condition of kata says you don't need that
Well, but you can add a validation for arguments to check if they're positive
Clever, didn't think of using i=n and the i-- to countdown. Would have made my solution just a tad bit shorter.
If dragons == 0 then it will be mistake
You're a genius!
I wrote the same way
Ah, that makes sense. I'll have to declare those in the future. Thank you for explaining :)
This comment is hidden because it contains spoiler information about the solution
Crazy how I wrote almost the exact same thing! Is the usage of let encouraged in a for loop? I made mines without it.
Thanks for your last post. Morality: don't post issues too fast:-) A good indication: when many people passed a kata (340 with Go) chances are the kata is not at fault.
Loading more items...