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.
Actually modifying the array is considered bad practice if unnecessary.
Btw, I upvoted myjinxin2015, as he definitely deserved it.
myjinxin2015: even though I think it's not correct approach and evaluation of tests should be independent of the modification to the original array (it still returns correct sum, doesn't it? and why it works with initial tests but not random?) you're right that it helps to pass the random tests. Once I changed code the way it works with copy of original array it works fine.
Anyway, you are not sensei of this kata and thanks for advice
I just said some advice, if you don't agree you can ignore it.
But why did I get a
downvote
? Unhappy :(please check your code, make sure that you haven't modified the original array ;-)
And same suggestion to other guys ;-)