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.
(If you run out of ammo at the same time as the remaining zombies reach you, return "You shot X zombies before being eaten: overwhelmed.".)
that is in the details, i think in the case mentioned you run out for ammo at the same time zobies reach you, since you need to mutiply range by 2 because zombies move 0.5 meters
The description is not clear about what is in your mind. Also, not all languages test this edge case.
Thank you for the feedback. I appreciate the thought and detail you put into it.
Like a few other kata I've seen, this is as much a math problem as a coding one. Unlike those, the math problem here is complicated and hard - the square pizza algorithm requires factoring n, which gets much harder as n increases. In combination with the large test numbers and the runtime limit, it becomes a "how many optimization tricks do you know" problem more than a math problem.
As-is, this is more difficult than I think it really needs to be. Depending on the difficulty level you're aiming for, I would recommend either:
Additonal suggestions:
That was pretty much it: in my mind "out of ammo" was the situation where you have run out of ammo and are just waiting for the zombies to get to you.
if(zombies==100 and distance==10 and ammo==20)...
the function returns:'You shot 20 zombies before being eaten: overwhelmed.'
Am I wrong in thinking the "reason" was loss of ammo?
there are 20 shots fire. One at each whole second, 1 through 10. One at each half second, 0.5 through 9.5.
So when the zombies arrive, we are out of ammo. Or, does overwhelmed encompass any situation where it is impossible to kill all the zombies even if we had infinite bullets.
remove ;
remove (n==101)+(n>101)
add (n>100)
The description does mention permutations, so perhaps it was my poor reading and comprehension. Nevertheless, I think adding a shorter example to clarify the directions would help.
The description mentions permutations:
find the sum of all numbers with the same digits(permutations) including duplicates
So do you want a short example
Well, the author is active, maybe he'll consider your suggestion.
This comment is hidden because it contains spoiler information about the solution
And didn't you read the examples?
How would that be looking through the numbers
1
through10**5
for matches?Wording is confusing. I thought I was looking through the numbers 1 through 10**5 for matches. Instead, we are adding permutations. Adding more clarifying examples might help.
7 --> 7
77 --> 7 + 7 = 14
122 --> 122 + 122 + 212 + 212 + 221 + 221 = 1110
does not work (well) for negative numbers.
Loading more items...