I'm trying to solve in Ruby the problem named 'Security'. What's wrong with my code? It fails on one of the test cases. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I'm trying to solve in Ruby the problem named 'Security'. What's wrong with my code? It fails on one of the test cases.

Casino Security https://code.sololearn.com/cvYtb474RcHh/?ref=app

14th Jan 2021, 11:13 PM
Yan Ayata
Yan Ayata - avatar
2 Answers
+ 5
It's possible that ther is more than 1 or multiple of each of the Guards, Thieves, or $. You don't really need to use regex at all for this challenge. You could use the gsub() method to simply remove all the x from the floor and then check with the include?() method for the presence of "T
quot; or "$T" remaining in the string.
15th Jan 2021, 12:53 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
There is 1 thief, 1 $ and any number of guards. Ok, good advice i just wanted to try regexps...Thank you.
15th Jan 2021, 1:07 AM
Yan Ayata
Yan Ayata - avatar