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 solution is not correct.
try this. actual answer should be 6.
console.log(maxSequence([-2, 1, -3, 4, -1, 2, 1, -5, 4]));
Still a pure function because in order for it to be impure , it would have to access variables OUTSIDE of the function call...this function would always output the exact same thing if given the same input because there is no outside state effecting what happens inside the function...
пиздец, я в шоке, как таким умным можно быть-то блять.
Your reducer is not a pure function because references currentSum which life outsize the function.
why not?
Great solution
I don't think you get the key of the puzzle ;-)
needs more random tests, check out my cheat solution passing :)
If truly random testing is impossible ( and I don't think so; you know how arbitrary human behaviour is supposed to be different from truly random behaviour ), you could at least randomize the order of testing.
Otherwise, cheating is just too easy.