Ad
  • Default User Avatar

    Thankyou for your response! I'll keep trying then :)

  • Custom User Avatar

    Sample tests are usually a very small portion of tests that are run.

    There is also a question mark next to the amount of tests I failed

    This just means that you haven't reached the end of test runner running all tests (due to timeout), so it wasn't sure how many tests there were in total. I was stuck in the same spot last time I tried it, but I know my code wasn't efficient at all, hence the timeout.

  • Default User Avatar

    When attempting the sample test, my solution succeeds. When pressing the attempt button, my solution succeeds for all of the 9 tests, but I still get a timed out error. There is also a question mark next to the amount of tests I failed. Has this something to do with the way I raise an exception/just inefficient code on my part? Thanks for the help.

  • Custom User Avatar

    Expected is error, because there is more than one valid solution, for example:

    |328|756|491|   |328|756|491|
    |416|239|785|   |416|239|785|
    |795|418|263|   |795|418|263|
    +---+---+---+   +---+---+---+
    |983|542|176|   |983|547|126|
    |564|197|328|   |564|192|378|
    |172|683|954|   |172|683|954|
    +---+---+---+   +---+---+---+
    |649|375|812|   |649|375|812|
    |851|924|637|   |851|924|637|
    |237|861|549|   |237|861|549|
    

    If I copied everything correctly, you can see how the rows in the middle band are different.

  • Custom User Avatar

    Hello,

    I've got two issues. Timeout and random tests that fail.
    Timeout is the fun part. Random tests is the strange part and i need some help.
    If I believe the output of the attempt :

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

    My solution is wrong but I have no idea of the expected.

    My solver found this solution :

    [
      [ 3,9,8,7,5,6,4,2,1 ]
      [ 4,1,6,3,2,9,7,8,5 ]
      [ 7,2,5,4,1,8,9,6,3 ]
      [ 9,8,3,5,4,2,1,7,6 ]
      [ 5,4,2,6,7,1,3,9,8 ]
      [ 1,6,7,9,8,3,2,5,4 ]
      [ 6,7,9,1,3,5,8,4,2 ]
      [ 8,5,1,2,9,4,6,3,7 ]
      [ 2,3,4,8,6,7,5,1,9 ]
    ]
    

    What should be the expected output ?

  • Default User Avatar

    i cant even describe how i struggled during this f#kin kata, it is almaust destroed my life. few mounths passed i did it, it was terrible but i like this pain. thank you hel yeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

  • Custom User Avatar

    @Erhu, proving that sudoku has multiple solution may be done in different ways and one of them is not that time-consuming.
    Think of what it means that there are several solutions in terms of the resulting elements positions & values.

  • Custom User Avatar

    AFAIU, if you have a sudoku with zero empty (zeroed) cells, which doesn't require to be solved, it should be marked as invalid.

  • Default User Avatar

    I seem to have a problem where the program asks me to mark a grid that seems valid as invalid, like this one:

    Input:
    [4, 8, 3, 5, 7, 1, 9, 2, 6]
    [2, 7, 9, 4, 8, 6, 3, 5, 1]
    [5, 1, 6, 9, 2, 3, 8, 7, 4]
    [1, 9, 4, 3, 6, 7, 5, 8, 2]
    [3, 6, 7, 2, 5, 8, 1, 4, 9]
    [8, 2, 5, 1, 9, 4, 7, 6, 3]
    [6, 5, 1, 7, 4, 9, 2, 3, 8]
    [9, 4, 2, 8, 3, 5, 6, 1, 7]
    [7, 3, 8, 6, 1, 2, 4, 9, 5]
    --------------------------
    [[4, 8, 3, 5, 7, 1, 9, 2, 6], [2, 7, 9, 4, 8, 6, 3, 5, 1], [5, 1, 6, 9, 2, 3, 8, 7, 4], [1, 9, 4, 3, 6, 7, 5, 8, 2], [3, 6, 7, 2, 5, 8, 1, 4, 9], [8, 2, 5, 1, 9, 4, 7, 6, 3], [6, 5, 1, 7, 4, 9, 2, 3, 8], [9, 4, 2, 8, 3, 5, 6, 1, 7], [7, 3, 8, 6, 1, 2, 4, 9, 5]]
    [[4, 8, 3, 5, 7, 1, 9, 2, 6], [2, 7, 9, 4, 8, 6, 3, 5, 1], [5, 1, 6, 9, 2, 3, 8, 7, 4], [1, 9, 4, 3, 6, 7, 5, 8, 2], [3, 6, 7, 2, 5, 8, 1, 4, 9], [8, 2, 5, 1, 9, 4, 7, 6, 3], [6, 5, 1, 7, 4, 9, 2, 3, 8], [9, 4, 2, 8, 3, 5, 6, 1, 7], [7, 3, 8, 6, 1, 2, 4, 9, 5]]
    there are 1 solutions
    

    I am sure this is simple oversight on my part, as many people have solved this in Python and I don't think that everyone has made a mistake but me. Still, I can't find a reason for why this grid should be invalid. If someone could enlighten me I would be very grateful as I have been working on my solution for a week and would love to finally submit it :).

  • Custom User Avatar

    @akar-0 Thanks for the advice, the difficulty is definitly in the back tracking, but like mentioned, the test results are inconsistent and it makes it hard to debug.

  • Custom User Avatar

    I run my solution 20 times. I got 4 timeouts, and remaining 16 runs had quite comsistent times of 5-8s. So yes, it seems that its possible to get a pessimistic case, but I think the ratio is not terrible, and i also think there is many better solutions than mine.

  • Custom User Avatar

    All katas have random tests (or should have). You give no proof that tests would be buggy. If you have not been able to solve this kata (I have not either) this cannot be considered a kata issue.

    Try to practica on easier ones, 2kyu katas are supposed to be hard coding challenge.

  • Custom User Avatar

    The tests are randomly generate, you just have to get lucky and not run into bugged one.

  • Custom User Avatar

    How did others, including me, solved it then?

  • Custom User Avatar

    It could have been a good test but proving sudoku has single solution requires backtracking, which make the job time out, mainly because of the 200 random tests.

  • Loading more items...