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.
No. At least two clues don't fit your solution.
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 ] ]
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!
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.
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.