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.
But the kata says the fighters array will always be the same, so there is no need to support possible addition of new fighters to the fighters array.
It turns a string into a number.
It turns a string into a number.
It turns a string into a number.
It turns a string into a number.
It turns a string into a number.
It turns a string into a number.
It turns a string into a number.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Because if n is an odd number, n/2 will be a value with decimal points but the example in the question shows that the question wants sums of integers. The example in the question shows that integers are added to the desired sum but not values with decimal points added to the desired sum.
The example in the question shows that each integer to be added to the sum is the result of every n/2 rounded down (to the nearest integer which is smaller than the n/2 value which has decimal points). Math.floor() rounds a number with decimal points down (to the nearest integer which is smaller than the n/2 value which has decimal points).
Comment erased
Thanks for the solution. I have learnt something new (can simply pass 'inputString' into the argument of parseInt without a reference to the index of the age number). Thanks so much!!
That's brilliant!!
Loading more items...