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.
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?
I got the same and "solved" it by including \t as an acceptable character. It's a bit weird.
One of the tests expects special characters to be retained, such as ~ / \ and others. Please fix the task, or remove this test?
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
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.
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.
Your code fails the very first test because it doesn't recognize that
Alice
DOES have a word that can be amutagram
for the starting wordaver
; in that she knows the wordover
which can be mutated fromaver
at the first letter.No matter what, don't give up!
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 :)
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
.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?