Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    very nice kata.
    specially the test cases were too good covering all possible failures.

  • Default User Avatar

    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

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution