Ad
  • Custom User Avatar

    I really liked solving this kata, but in the end of the day it was super frustrating that time after time optimizations did not result into all tests passing within the time limit!
    I'd suggest to add a hint to the description about the desired solving speed in the description, so that one may estimate how far is he or she from "getting there".

    For me, the solution that passed solved the basic test case in ±30-50ms.

    Small hint regarding optimization in Python: try using cProfile to find out which part of the program takes the most time to execute.

  • Default User Avatar

    cannot cross more than 172 tests should i quite? or keep trying?

  • Default User Avatar

    can anyone help this nub?
    what are the criteria of an in valid sudoku grid(unsolved)

    if values out of range (1-9)
    if given clue < 17
    if given clue digit set < 8 ie ((n**2) -1)
    if cules are other than int
    if grid dimension is distorted
    if clues in row col or blocks are repeated
    if have multiple solution

  • Default User Avatar

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

  • Default User Avatar

    Solved using optimised backtracking algorithm. But sometimes it fails with 'Invalid grid should raise exception' at random tests. I check for multiple solutions. Fixed test with multiple solution passed. What can be wrong with grid that I don't check?
    P.S. I've managed to submit solutions since it passes sometimes :)

  • Default User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    I'm not sure I understand the assignment here. How am I supposed to figure out if a puzzle is unsolvable without searching.. literally every sudoku board that could generate from the seed I'm given?

  • Custom User Avatar

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

  • Default User Avatar
     int[][] p1 = {{9,0,6,0,7,0,4,0,3},
                {0,0,0,4,0,0,2,0,0},
                {0,7,0,0,2,3,0,1,0},
                {5,0,0,0,0,0,1,0,0},
                {0,4,0,2,0,8,0,6,0},
                {0,0,3,0,0,0,0,0,5},
                {0,3,0,7,0,0,0,5,0},
                {0,0,7,0,0,5,0,0,0},
                {4,0,5,0,1,0,7,0,8}};
    
     int[][] p2 = {{3,4,7,9,0,0,0,8,0},
                {0,1,0,8,0,0,0,5,0},
                {0,0,0,0,0,0,0,1,0},
                {0,0,0,5,0,0,0,0,8},
                {0,0,0,4,0,8,0,0,0},
                {6,0,0,0,0,3,0,0,0},
                {0,7,0,0,0,0,0,0,0},
                {0,8,0,0,0,5,0,3,0},
                {0,5,0,0,0,4,2,7,9}};
    

    I found one solution for each of them.

    Why should they throw an IllegalArgumentException??

    There are more than 16 Given Numbers and also 8 different numbers given.

    The Grid size is valid.

  • Default User Avatar

    Haskell translation added, please approve!

  • Custom User Avatar

    This is not a kata.

  • Custom User Avatar

    Need a hint on how to detect if a puzzle has multiple solutions?

    edit: it looks like backtracking cannot detect this kind of issues, and it's not fast enough either...