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.
Thank you!
arr = [4, 4, 4, 4, 4, 4, 4, 1]
test.assert_equals(track_sum(arr),[[29, 5, 3, 3], [3]])
As I understand the second itteration should be [4, 1] and sum 5 and the third [3] sum = 3
Why the answer is not [[29, 5, 3], [3]]? Where am I wrong?
if('n') is always true as well as other expressions of a kind
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hi Natan,
I did it other way by figuring out what kind of number to go for, etc. instead of simple 3-liner as in Python. Even that failed to pass all the test suite. I noticed it fails when trying to cath negative odd, so putting Math.abs() everyhere worked out. I finaly did it, but to my big surprise the most promoted solution appears to be the same 3-liner as mine in Python.
I've succeeded with this kata in Python and repeated just the same algorithm in JS. It passed simple tests, but failed all the suite. Is this kata about algorithm as labeled?