+ 1
Why does my solution to "Security" code coach not work?
In this code, https://code.sololearn.com/cj0iE2wtNkky/?ref=app I used regex to match the casino layout. For some reason when I try to run this code, all tests are successful EXCEPT last test. I can't find a layout where my regex would not work. Can someone help me?
5 ответов
+ 1
Ex: $xGxGxGxT failing..
Your checking G in between $, T atleast one. and actually there may be $xGxGxGxGT like patterns, which may fail. Because there is no sure pattern..
First remove x,
then your way works simply for any case
+ 1
Hmm, I changed pattern a little bit, now it has to work, and it works in all case tests, even the last one, but the fourth case test does not work. What did I do wrong now?
+ 1
Ex:
$xTxG failing
[Gx]+ means 'G' Or 'x' at least ones..
+ 1
I sat thinking for an hour and I finally made it work! Thanks for finding failing prompts
0
I think you can simplify it by just first remove x from input string (as x as no special value) then use your previous first regex.
You're welcome..