Ad
  • Custom User Avatar

    ahahaha yeah I thought so too and then I realised I don't know how sudoku wokrs lol

  • Custom User Avatar

    In sudoku also 3x3 grid can not have the same numbers

    The whole thing is a 9x9 grid, which is made of 9 3x3 grids, in which all 9 numbers also have to be different

  • Custom User Avatar

    Hi @Gates_TN - check the top left 3x3 square of this grid: there are repeated 2's, 3's, 4's.

    [1, 2, 3, 4, 5, 6, 7, 8, 9] ,  # <-- 123 first 3 entries
    [2, 3, 4, 5, 6, 7, 8, 9, 1] ,  # <-- 234 first 3 entries
    [3, 4, 5, 6, 7, 8, 9, 1, 2] ,  # <-- 345 first 3 entries
    [4, 5, 6, 7, 8, 9, 1, 2, 3] ,        ^^^ 
    [5, 6, 7, 8, 9, 1, 2, 3, 4] ,        3x3 square with repeated 
    [6, 7, 8, 9, 1, 2, 3, 4, 5] ,            2's, 3's, 4's
    [7, 8, 9, 1, 2, 3, 4, 5, 6] ,
    [8, 9, 1, 2, 3, 4, 5, 6, 7] ,
    [9, 1, 2, 3, 4, 5, 6, 7, 8]
    
  • Custom User Avatar

    i think the last test should be True expected not false!
    test.assert_equals(valid_solution([[1, 2, 3, 4, 5, 6, 7, 8, 9]
    ,[2, 3, 4, 5, 6, 7, 8, 9, 1]
    ,[3, 4, 5, 6, 7, 8, 9, 1, 2]
    ,[4, 5, 6, 7, 8, 9, 1, 2, 3]
    ,[5, 6, 7, 8, 9, 1, 2, 3, 4]
    ,[6, 7, 8, 9, 1, 2, 3, 4, 5]
    ,[7, 8, 9, 1, 2, 3, 4, 5, 6]
    ,[8, 9, 1, 2, 3, 4, 5, 6, 7]
    ,[9, 1, 2, 3, 4, 5, 6, 7, 8]]), False);