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
very nice kata.
specially the test cases were too good covering all possible failures.
testing(209917, "[29917, 0, 1]")
=> digit 2 is moved, not digit 0 to position of 0(j=>1) so number became 029917 => 29917
testing(269045, "[26945, 3, 0]");
=> digit 0 is moved from initial position(i=>3) to begining (j =0) so result is 026945 => 29917
hence the indexing
with 1->10, 2->0 result will be 0325833691764184 => 325833691764184
while with 1 ->0, 2->10 result will become 258336917-3-064184
Important point is : it is not swapping of two number but only the number at position 1 is moved to position 2.
In case of 209917 i,j are next to each other so moving digit at position 1 to 2 looks like a swap but it is not.
There is mismatch in kata problem statement and test suit.
In kata expected result is an array with first and second index values as result,
but with test suit and prototype of count_positives_sum_negatives result is returned in two different variables.
This comment is hidden because it contains spoiler information about the solution