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'm also a big fan of not using magic numbers. Even in a "simple one-liner".
You're removing those numbers from the input, so, when the control function calculates its sum, it's using the other numbers:
136 + 128 + 83 = 347
Anyways, I've changed the tests so the expected value is computed first and your code messing with the input isn't a problem anymore, but be aware of that.Don't mutate the input.
In bigger projects i would expect such constants. That is much better, than 'magic' 0.5. But if we want just simple function... =)