[SOLVED] Security problem...
You are in charge of security at a casino, and there is a thief who is trying to steal the casino's money! Look over the security diagrams to make sure that you always have a guard between the thief and the money! There is one money location, one thief, and any number of guards on each floor of the casino. Task: Evaluate a given floor of the casino to determine if there is a guard between the money and the thief, if there is not, you will sound an alarm. My Solution: n = input() c = "" for i in n: if i != 'x': c = c + i a = c.index("G") b = c.index("$") c = c.index("T") if b >= a and c >= b: print("quiet") elif a < b: print("ALARM") elif b < a and b < c: print("quiet") else: print("ALARM") #Unable to pass only one test case :(