+ 1
Error in security challenge
I tried to solve security challenge, and I did, but the third input in the challenge don't was right, for this I swap the output for seeing if there was an error, and it there was, it wants the "quiet" output, where the the output should be "ALARM". Now I don't know if it's an upload fault, but this is an error, for this if someone found a solution for this problem, please tell me. (And tell me also if it isn't an error and my code could be bad)
6 odpowiedzi
+ 9
Francesco Manuel Ursini , could you please mention the programming languag? Thnks!
+ 3
Francesco Manuel Ursini post your attempt
+ 2
Davide this is the code :
from re import findall
x = input()
y = r"[G$Tx]"
z = findall(y, x)
n2 = z.index("quot;)
n3 = z.index("T")
a = z[n2:n3]
if "G" in a :
print("quiet")
else:
print("ALARM")
0
i filtered all the x's away, and got for example 'GG$GT'. Then i did a for loop in which i xored floor[i] with floor[i+1], the nice thing about xor is that xoring 'T' with '#x27; and '#x27; with 'T' gives you the same result ('p'). so if there is a 'p' in the result, the output should be 'ALARM'.