Evaluate a given floor of the casino to determine if there is a guard between the money and the thief, if there is not | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 4

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 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. Input Format: A string of characters that includes $ (money), T (thief), and G (guard), that represents the layout of the casino floor. Space on the casino floor that is not occupied by either money, the thief, or a guard is represented by the character x. Output Format: A string that says 'ALARM' if the money is in danger or 'quiet' if the money is safe. Sample Input: xxxxxGxx$xxxT Sample Output: ALARM

28th Apr 2021, 6:10 PM
Abhishek Kumar
Abhishek Kumar - avatar
2 Answers
0
Share your attempt.
29th Apr 2021, 1:00 AM
Josh Greig
Josh Greig - avatar
0
Hello everyone, choosing a legal online casino is important to ensure safe and fair gaming. When choosing a casino, be sure to check whether it is licensed. In addition, always choose a casino with a good reputation and positive feedback from players. For example, https://www.casinoonline.com.se/ has a good review with a detailed description of reliable online casinos.
4th Oct 2023, 11:09 PM
Gretel