Ad
  • Custom User Avatar

    Hi, thank you for sharing your work around. But in this case when I print the original incoming string, I can see that it does not contain '\t' at all, yet it is expected in the output string. I am not sure why?

  • Custom User Avatar

    I got the same and "solved" it by including \t as an acceptable character. It's a bit weird.

  • Custom User Avatar

    One of the tests expects special characters to be retained, such as ~ / \ and others. Please fix the task, or remove this test?

  • Custom User Avatar

    Are we expected to insert '\t' in result string when incoming string does not have it?
    My solution is failing the following input:
    st = ' S]r(2 (y%nF=<

    My result is:
    result = Sr2ynF
    I get the following error:
    ' Sr2ynF' should equal ' Sr2\tynF'

    Thanks

  • Custom User Avatar

    You should ensure that whatever outside system you're using, that it in fact has the correct expected values for the given input. For example, your code fails the 5th fixed test. What answer does PyCharm have for that one? Does it match Codewars? Does all the input match? Once you certify all that, you can debug why your code fails that one particular test.

    Better yet, just work on site only, that will simplify things greatly.

  • Custom User Avatar

    Thank you for encouraging! I have now tried out all the additional test cases in pycharm which work absolutely fine individually for corresponding word/lists/first player. However, when I run all the test cases together as a single script some randomly fail - that must be happening in codewars too. Still trying to figure out the reason.

  • Custom User Avatar

    Your code fails the very first test because it doesn't recognize that Alice DOES have a word that can be a mutagram for the starting word aver; in that she knows the word over which can be mutated from aver at the first letter.

    No matter what, don't give up!

  • Custom User Avatar

    Hi there, I have struggled with this one tbh - but also enjoyed. Have now handled the unique letter condition and managed the persisting variables issue between test cases by calling the reset method just before each return statement. The initial 8 test cases pass - however still the attempt fails. Could it be because I keep removing matched items from alice and bob lists and the test cases seem to use a single copy of the lists... which are basically shrinking? Probably I will just lose some points and look at others' code - been on this for very long time! Thank you so much for the quick and helpful hint :)

  • Custom User Avatar

    Hello, welcome to Codewars. I'm glad your're enjoying the kata.

    I looked at your code and found that your method does not adhere to one of the rules: a valid response word must contain four unique letters.

  • Custom User Avatar

    Hi, I am new to this forum and this is my first post. I found this problem very intriguing and have tried it for long but wasn't able to figure out how to persist the state of successful match or failed turn before passing it over between Alice and Bob. Finally, I ended up using a class with static variables to persist between recursive calls which solved it and works fine for each individual test case separately. However, when the entire script is run together, the states persist between test cases and lead to random responses each time. I tried to import my class in the script and use a reset method between each test case - works fine on pycharm but here it doen't allow the import. Apologies about the long description - wanted to know if anyone used similar approach or I have over complicated it. I think I can't view other solutions because I haven't been able to submit mine successfully. Any pointers?