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?

  • Custom User Avatar

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

  • 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

    what the heck is this
    It should work for random tests too -
    Expected: '368662 87 215801 84 165100 38 328700 112 418974 62 161 84 478254 193 295671 184 330904 170 356591 16 198732',
    'instead got: '112 16 161 170 62 38 84 84 165100 184 193 87 215801 330904 328700 356591 198732 295671 478254 368662 418974'

  • 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.
    
  • Custom User Avatar

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