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.
see open issue in translation
Ahh! You were correct! I was not removing the Black Pegs first, allowing for false White Peg values.
Thanks for pointing that out to me!
Your logic is correct but solution is not. In the second example we can remove the black pegs and see that you're matching three
1
's insideguess
with a single1
insideanswer
which is obviously wrong:I'm having some difficulty troubleshooting my code. All the test pass, but when I do the Attempt, I get some that are incorrect. I've been tweeking this for a while now and can't figure out where my logic is wrong. My code is working as written, just not getting the correct outcome. See below example of what is perplexing me.
If I understand correctly, the logic is as follows:
One of the scenario is:
Answer set: [1,1,1,2,2,2,1,1,1,2,2,2,3,3,3]
Guess set: [1,1,1,1,1,1,2,1,1,1,1,2,3,1,1]
My Result: [B,B,B,W,W,W,W,X,X,X,X,B,B,X,X] {B: 5, W: 4}
Kata Correct result {B:5, W: 2}
Similary, another scenario is:
Answer set: [1,1,1,2,2,2,1,1,1,2,2,2,3,3,3]
Guess set: [3,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
My Result: [W,B,B,W,W,W,B,B,B,X,X,X,X,X,X] {B: 5, W: 4}
Kata Correct result: {B: 5, W: 2}
If anyone knows what I am missing about the rules for W assignment, the help would be greatly appreciated!
Thanks!
Yes, this does seem to be my issue. I was missing that scenario in my code. Working now to correct.
Thanks Guaz!
Nice kata!
If graph is connected isn't a solution, for example.
When you for example test {0:[1,2,3], 1:[0], 2:[0], 3:[0]}, this graph is connected, however you're able to split persons for two groups ([0] and [1,2,3] .
Graph don't have to be disconnected, to be True. I believe you failing this part, but I may assume wrong.
Comment has been hidden :/
You need to provide some concrete information or nothing can be done.
I have done the logical troubleshooting. And yes, maybe it is my code and not an issue of the Kata. But, as the link suggested, I have ran them manually, checked the input cases that are failing (was well as some that are passing), and ran two successive calls with different inputs. So, again, maybe I'm missing something. Sorry to bother anyone by misclassifying this as an issue.
Your code not working is not an issue (= a bug in the kata), maybe a question? Please refer to the documentation: https://docs.codewars.com/training/troubleshooting/
I feel like I'm missing something. I have ran this multiple times with slight variations and seem to be missing the same test cases. I have manually checked the test cases that I can, and my logic/code should be producing the correct outcome, but for some reason it is not. More than happy to share my code.
Failing the last 3 connected graphs/tests: Saying they should be True but I am getting False. I would think that the connected ones should be False.