Ad
  • Custom User Avatar

    The board is always 9 cells by 9 cells, and every cell only contains integers from 0 to 9. So, this is not within the scope of kata

  • Custom User Avatar

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

  • Custom User Avatar

    Even though I see your point, why would you even try data outside the valid inputs?

  • Custom User Avatar

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

  • Custom User Avatar

    Add this tests to your solution and check it:

    Test.assertEquals(validSolution([[5, 5, 5, 5, 5, 5, 5, 5, 5], 
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5],
                                     [5, 5, 5, 5, 5, 5, 5, 5, 5]]), false);
                                     
    Test.assertEquals(validSolution([[45, 0, 0, 0, 0, 0, 0, 0, 0], 
                                     [0, 0, 0, 45, 0, 0, 0, 0, 0],
                                     [0, 0, 0, 0, 0, 0,45, 0, 0],
                                     [0,45, 0, 0, 0, 0, 0, 0, 0],
                                     [0, 0, 0, 0,45, 0, 0, 0, 0],
                                     [0, 0, 0, 0, 0, 0, 0,45, 0],
                                     [0, 0,45, 0, 0, 0, 0, 0, 0],
                                     [0, 0, 0, 0, 0,45, 0, 0, 0],
                                     [0, 0, 0, 0, 0, 0, 0, 0,45]]), false);