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.
If you click "show solution" under a comment with the kata set to a specific lang then it will show the users last submitted attempt (or passed attempt) for that lang.
Hi Voile.
Thank you for your comments.
It was four years ago I forgot everything that I was doing there.
I will be grateful if you can explain me how and where you can see my solution code?
Also, even if you do manage to solve your data integrity issues, you'll probably still timeout, as you're using an inferior algorithm. Parallelism isn't going to help you here.
I didn't decide that you're using parallelism; you're using
Parallel.For
, which literally hasParallel
in its name, and is a parallism construct.If you don't even know what you're using before using it and ended up shooting yourself in the foot, I'd suggest actually looking it up first?
Also, for the record, I can see your solution code; there are exactly 2 spots where concurrency issue exists.
Hi Volie.
Why did you decide that I use parallelism?
Anyways, the problem you're having is, you're using parallelism, but you never made any attempt to make your code thread-safe, so the values become messed up once input size gets big.
This is not really a issue, this is a question.
LOL
O_O
40585
Please help, why this test failed:
Test #1, testing for:
chessBoard
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,0,1,1,1,1,1
1,1,1,1,1,1,1,1,0,1,1,1
1,1,1,1,1,1,1,1,1,1,1,0
1,1,1,1,1,1,1,1,1,0,1,1
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,0
Test Failed
Expected is <System.Collections.Generic.Dictionary
2[System.Int32,System.Int32]> with 8 elements, actual is <System.Collections.Generic.Dictionary
2[System.Int32,System.Int32]> with 7 elementsi receive 8 elements:
[0] {[2, 106]}
[1] {[3, 78]}
[2] {[4, 58]}
[3] {[5, 41]}
[4] {[6, 26]}
[5] {[7, 13]}
[6] {[8, 5]}
[7] {[9, 1]}