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.
This comment is hidden because it contains spoiler information about the solution
I think a reason/scenario for not changing the original array should be given so we know why not to change it. I did forget to account for negative numbers too, so I agree with both statements.
Thanks for all comments.
I updated description.
Good that you added a specification of the approximation to the description. I tried it before that and ended up implementing a solution based on infinite series. My solution was more exact, but failed because you assumed an approximation.
Btw, ellipse is spelled with two 'l's.
It passed the tests. Which is enough for me :)
This comment is hidden because it contains spoiler information about the solution
Test cases should be updated to
a) check that the original array is not mutated (as per the description)
b) pass in some negative numbers (as the description explicitly says that only positive numbers should be summed)
This comment is hidden because it contains spoiler information about the solution