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.
Thankyou for your response! I'll keep trying then :)
Sample tests are usually a very small portion of tests that are run.
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.
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.
Expected is error, because there is more than one valid solution, for example:
If I copied everything correctly, you can see how the rows in the middle band are different.
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 :
My solution is wrong but I have no idea of the expected.
My solver found this solution :
What should be the expected output ?
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
@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.
AFAIU, if you have a sudoku with zero empty (zeroed) cells, which doesn't require to be solved, it should be marked as invalid.
I seem to have a problem where the program asks me to mark a grid that seems valid as invalid, like this one:
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 :).
@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.
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.
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.
The tests are randomly generate, you just have to get lucky and not run into bugged one.
How did others, including me, solved it then?
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...