Ad
  • Default User Avatar

    @Chrono79 I did the same and it don't change expected result. Problem is in the code of @hangnhat57.
    @hangnhat57: issue resolved.
    Please, in the future, don't post issues so fast. Before, take a look at how many people passed the kata in your language (see the top of the page). If this number is high enough, chances are that the problem is in your code; otherwise you make people waste their time. Cheers.

  • Custom User Avatar

    It seems it's related to your code changing Array.prototype.
    I changed that part and your code worked without changing the expected results. And why does your code have an if/else if that does the same? Wouldn't it be better to use only an if with both conditions?

  • Default User Avatar

    Language? I suppose it is JS from your profile. Could you post your code properly formatted between 3 backticks at the beginning and at the end and marked as "Spoiler" (I wanted to run your code as seen in "View Solution" but I got several errors and it is impossible to make it run). Notice at the top of the page that 5629 people passed the JS kata... Cheers.

  • Custom User Avatar

    You really don't like to read, do you? It tells you in the description and people have written comments about it.

    You are meant to divide each the box of 9x9 into sub-boxes of 3x3. You are only meant to have each number once in each column, line and sub-box. However the numbers 2, 3, 4 all appear multiple times in the same sub-box, instead of just once and therefore the other numbers don't appear at all.

    each sub 3x3 matrix should be 123456789
    
    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
    
    The first box
    
    1 2 3
    2 3 4
    3 4 5
    
    invalidates the third Sudoku rule.