Ad
  • Custom User Avatar

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

  • Custom User Avatar

    kata discription is shit

    you have VALID_WORDS set
    try console.log(VALID_WORDS)

  • Custom User Avatar

    not very easy for newbie as a 7kyu kata if didn't get a clever trick

  • Custom User Avatar

    Oh, I am so careless about the condition, yes, it is a necessary but not enough condition. Thanks! It is really a hard kata

  • Custom User Avatar

    That condition is necessary but not enough. You can be sure that with less than 17 you can't have unique solutions, but as you see, with 29 givens you still can have multiple solutions.

  • Custom User Avatar

    according to kata description:
    Note: The minimum of givens required to create a unique (with no multiple solutions) sudoku game is 17.

    so the first one should have unique solution, for it has 29 givens (>17), why there are multiple solutions?

    original puzzle is valid, and solvable, and > 17 givens, so it should pass the test. maybe the description is somewhere wrong

  • Custom User Avatar

    The first solution is not unique, this one works too:

    [[8, 2, 1, 5, 7, 4, 6, 9, 3], 
     [3, 4, 5, 2, 6, 9, 1, 7, 8], 
     [7, 9, 6, 8, 3, 1, 5, 2, 4], 
     [2, 5, 9, 4, 8, 7, 3, 6, 1], // In these 2 files we swapped 9 and 4 of the 3rd and 4th columns
     [1, 3, 4, 9, 5, 6, 2, 8, 7], 
     [6, 8, 7, 1, 2, 3, 9, 4, 5], 
     [5, 7, 8, 3, 9, 2, 4, 1, 6], 
     [9, 1, 3, 6, 4, 8, 7, 5, 2], 
     [4, 6, 2, 7, 1, 5, 8, 3, 9]]
    

    Or it should raise an error in cases of: invalid grid (not 9x9, cell with values not in the range 1~9); multiple solutions for the same puzzle or the puzzle is unsolvable

    I suspect the other may be the same case.

    [[3, 9, 6, 4, 7, 5, 1, 2, 8], 
     [8, 7, 1, 9, 6, 2, 5, 3, 6], 
     [4, 2, 5, 1, 3, 8, 4, 9, 7], 
     [1, 6, 3, 7, 8, 4, 9, 5, 2], 
     [7, 8, 2, 3, 5, 9, 6, 4, 1], 
     [5, 4, 9, 6, 2, 1, 7, 8, 3], 
     [6, 1, 4, 2, 9, 3, 8, 7, 5], 
     [2, 5, 7, 8, 4, 6, 3, 1, 9], 
     [9, 3, 8, 5, 1, 7, 2, 6, 4]]
    
  • Custom User Avatar

    ruby random test:
    puzzle:
    [[8, 0, 0, 5, 0, 0, 0, 0, 3], [0, 0, 5, 0, 6, 0, 1, 0, 0], [7, 0, 0, 0, 0, 1, 0, 2, 4], [0, 5, 0, 0, 8, 0, 3, 0, 0], [1, 0, 0, 0, 0, 0, 2, 0, 7], [0, 0, 7, 0, 2, 0, 0, 4, 0], [5, 7, 0, 3, 0, 0, 0, 0, 6], [0, 0, 3, 0, 4, 0, 7, 0, 0], [4, 0, 0, 0, 0, 5, 0, 0, 9]]
    my solved:
    [[8, 2, 1, 5, 7, 4, 6, 9, 3], [3, 4, 5, 2, 6, 9, 1, 7, 8], [7, 9, 6, 8, 3, 1, 5, 2, 4], [2, 5, 4, 9, 8, 7, 3, 6, 1], [1, 3, 9, 4, 5, 6, 2, 8, 7], [6, 8, 7, 1, 2, 3, 9, 4, 5], [5, 7, 8, 3, 9, 2, 4, 1, 6], [9, 1, 3, 6, 4, 8, 7, 5, 2], [4, 6, 2, 7, 1, 5, 8, 3, 9]]
    why Value is not what was expected??? many random test in ruby seems uncorrect.

    [[3, 0, 0, 0, 0, 5, 0, 0, 8], [0, 0, 1, 0, 6, 0, 5, 0, 0], [4, 2, 0, 1, 0, 0, 0, 0, 7], [0, 0, 3, 0, 8, 0, 0, 5, 0], [7, 0, 2, 0, 0, 0, 0, 0, 1], [0, 4, 0, 0, 2, 0, 7, 0, 0], [6, 0, 0, 0, 0, 3, 0, 7, 5], [0, 0, 7, 0, 4, 0, 3, 0, 0], [9, 0, 0, 5, 0, 0, 0, 0, 4]]
    [[3, 9, 6, 4, 7, 5, 1, 2, 8], [8, 7, 1, 9, 6, 2, 5, 4, 3], [4, 2, 5, 1, 3, 8, 6, 9, 7], [1, 6, 3, 7, 8, 4, 9, 5, 2], [7, 8, 2, 6, 5, 9, 4, 3, 1], [5, 4, 9, 3, 2, 1, 7, 8, 6], [6, 1, 4, 2, 9, 3, 8, 7, 5], [2, 5, 7, 8, 4, 6, 3, 1, 9], [9, 3, 8, 5, 1, 7, 2, 6, 4]]
    Value is not what was expected

    thanks for notice where i am wrong

  • Custom User Avatar

    the kyu values are all over the place, I've seen pretty hard 7 and 6 kyu and really easy 4 kyu.

  • Custom User Avatar
  • Custom User Avatar

    should be: 3 - Expected: 3, instead got: 1
    error in 1001 in ruby

  • Custom User Avatar

    My guess is that you modified the input string instead of returning a new one ...

  • Custom User Avatar

    [40,29,13,21,31,10,49,40,40,4]
    for first 40, 40 % [40,29,13,21,31,10,49,40,40,4].size == 0, so 40 is alone in result arr,
    but for nex 29, why 29 is alone??? it is not 29 % [29,13,21,31,10,49,40,40,4].size = 29 % 9 = 2,
    so [29, 13] is result??? at this moment should get [40,[29,13],21,31,10,49,40,40,4]
    it is not a good description for this kata, making so confused

  • Custom User Avatar

    1000+ people solved it without a problem...

  • Custom User Avatar

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

  • Loading more items...