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?
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
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.
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 :)
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?