+ 1

Security [Challenge Question](hard)

Though this code passed all tests,yet I feel it has lots of loopholes. Please check it and tell me where it has loopholes. Please suggest me alternative way to solve this question with minimum steps https://code.sololearn.com/cNElp5Lxj2mQ/?ref=app

20th Mar 2022, 6:26 AM
Md Saif Ali
Md Saif Ali - avatar
11 Respuestas
+ 4
JaScript by the way thankyou for your precious time
20th Mar 2022, 10:03 AM
Md Saif Ali
Md Saif Ali - avatar
+ 3
Of course, but faster and easier will be the idea as here in the solution with Python as follows: t = input().replace("x", "") print("ALARM" if "$T" in t or "T
quot; in t else "quiet")
20th Mar 2022, 8:06 AM
JaScript
JaScript - avatar
+ 3
Md Saif ali did you find realization of the above mentioned Python code in Java? If you want you can see that here: https://code.sololearn.com/cIj81srYpWeb/?ref=app
20th Mar 2022, 12:51 PM
JaScript
JaScript - avatar
+ 2
trim() is good thought, but not so really effective. If you remove additional all x from input it would be better. Then you can test the location of neighbors.
20th Mar 2022, 7:20 AM
JaScript
JaScript - avatar
+ 2
JaScript Can we create a String which store only g,t,m . And we then we will find index of m then we will run loop which will check 't' [both at a+i ,a-i ...where "a" is index of m]won't appear before g?
20th Mar 2022, 7:50 AM
Md Saif Ali
Md Saif Ali - avatar
+ 2
JaScript your code is nice. And I am trying to write in python
20th Mar 2022, 1:02 PM
Md Saif Ali
Md Saif Ali - avatar
+ 1
JaScript Agreed but I wanna solve this question with java
20th Mar 2022, 8:34 AM
Md Saif Ali
Md Saif Ali - avatar
+ 1
Md Saif ali I left that to you, the research, how can it be written in Java. A solution approach or idea is in my opinion the most important. The implementation is then fun.
20th Mar 2022, 10:01 AM
JaScript
JaScript - avatar
+ 1
Md Saif ali you are welcome! I enjoy it.
20th Mar 2022, 10:06 AM
JaScript
JaScript - avatar
+ 1
Hi what is utf-8???
21st Mar 2022, 9:58 PM
Narges Nezamdoust
+ 1
FlowerNarges I didn't find the line or code segment about which you are talking about.
22nd Mar 2022, 4:39 AM
Md Saif Ali
Md Saif Ali - avatar