Ad
  • Default User Avatar

    Tests are not correct, there may exist more than one solution for a specific input!. Both solutions shown below are valid.

    Input: [0,2,3,0,2,0,0,5,0,4,5,0,4,0,0,4,2,0,0,0,6,5,2,2,2,2,4,1]

    Expected: [ [ 7, 6, 2, 1, 5, 4, 3 ], [ 1, 3, 5, 4, 2, 7, 6 ], [ 6, 5, 4, 7, 3, 2, 1 ], [ 5, 1, 7, 6, 4, 3, 2 ], [ 4, 2, 1, 3, 7, 6, 5 ], [ 3, 7, 6, 2, 1, 5, 4 ], [ 2, 4, 3, 5, 6, 1, 7 ] ]

    Actual: [ [ 7, 6, 5, 4, 2, 1, 3 ], [ 3, 4, 2, 5, 1, 7, 6 ], [ 6, 5, 4, 7, 3, 2, 1 ], [ 5, 7, 6, 1, 4, 3, 2 ], [ 4, 3, 1, 2, 7, 6, 5 ], [ 2, 1, 7, 3, 6, 5, 4 ], [ 1, 2, 3, 6, 5, 4, 7 ] ]

  • Default User Avatar

    For input {3,2,2,3,2,1,1,2,3,3,2,2,5,1,2,2,4,3,3,2,1,2,2,4} my algorithm produces valid solution
    [ [ 2, 4, 1, 3, 5, 6 ], [ 1, 6, 3, 2, 4, 5 ], [ 4, 1, 6, 5, 2, 3 ], [ 6, 5, 2, 1, 3, 4 ], [ 5, 3, 4, 6, 1, 2 ], [ 3, 2, 5, 4, 6, 1 ] ]
    yet the test expect
    [ [ 2, 1, 4, 3, 5, 6 ], [ 1, 6, 3, 2, 4, 5 ], [ 4, 3, 6, 5, 1, 2 ], [ 6, 5, 2, 1, 3, 4 ], [ 5, 4, 1, 6, 2, 3 ], [ 3, 2, 5, 4, 6, 1 ] ]
    and thus fails.
    Problem with the tests is that there might be more than valid solution!

  • Default User Avatar

    C++: For input {2,2,1,3,2,2,3,1,1,2,2,3,3,2,1,3} my algorithm produces (valid) solution {{1,3,4,2},{4,2,1,3},{3,4,2,1},{2,1,3,4}} yet the test says it's wrong.

  • Default User Avatar

    for input {2,2,1,3,2,2,3,1,1,2,2,3,3,2,1,3} my algorithm produces valid solution {{1,3,4,2},{4,2,1,3},{3,4,2,1},{2,1,3,4}}
    yet the test says it's wrong.