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.
the length of your code is not equal to the code above)
hmmmm...
@dinglemouse it is really nice solution to this Kata. I've come up with 70 lines of code comparing to yours 10
Your algorithm is quite long. its inefficient to say the least.
You could have coded using the arithmetic mathematical formula {val_nth_term = first+c(n)} --> . It makes your life easier
I forgot to remove 'counter' variable in 1st for loop. Its useless
This comment is hidden because it contains spoiler information about the solution
Ok. I get the logic :D
No. The
return
the only way out of the loop. Thewhile (true)
is OK only because a death of a fighter is guaranteed by the rules of this Kata which says initial health and damage values of each fighter are > 0. In other word somebody must die.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution