Ad
  • Custom User Avatar

    see open issue in translation

  • Default User Avatar

    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!

  • Custom User Avatar

    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 inside guess with a single 1 inside answer which is obviously wrong:

    Answer set:  [1,_,_,2,2,2,_,_,_,2,2,2,3,3,3]
    Guess set:   [3,_,_,1,1,1,_,_,_,1,1,1,1,1,1]
    Your answer: [W,_,_,W,W,W,_,_,_,_,_,_,_,_,_]
    
  • Default User Avatar

    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:

    • If a Color is a match AND in the same position = it should be BLACK.
    • If a color is a match but NOT in the same location = it should be white with a caviat
      • Caviat: the match has not already been "used" (e.g. already black or already matched as white)

    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!

  • Default User Avatar

    Yes, this does seem to be my issue. I was missing that scenario in my code. Working now to correct.

    Thanks Guaz!

  • Custom User Avatar
  • Default User Avatar

    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.

  • Default User Avatar

    Comment has been hidden :/

  • Custom User Avatar

    You need to provide some concrete information or nothing can be done.

  • Default User Avatar

    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.

  • Custom User Avatar

    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/

  • Default User Avatar

    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.