Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
@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.
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?
This comment is hidden because it contains spoiler information about the solution
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.
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'
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.
This comment is hidden because it contains spoiler information about the solution