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 like this more than the recursive solutions
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).
Thank you for the tip!
it doesnt work!
Better idea I agree
This comment is hidden because it contains spoiler information about the solution
that is nice 👍
You could use shift operator here, friend