0
Why this fails in 2 test cases ?
This is my code for code coach security problem...please help me find the errors dia = str(input()) money = "
quot; thief = "T" grds = [] for i in range(len(dia)): if dia[i] == "G": grds.append(i) if all(grds) not in range(dia.index(thief),dia.index(money)): print("ALARM") else: print("quiet")3 Answers
+ 2
This can you see if you would test your code in playground for a few examples and analyse the results.
+ 1
Please understand the best way to lern is try to solve it yourself. You can take a pencil and paper and sketch the states and try again. Have fun with it.
0
The only issue is that it doesn't take in count the multiple G's...can anybody give a solution to that ?