Security Code Challange Problem | Sololearn: Learn to code for FREE!


Security Code Challange Problem

I dont know what is wrong with this code but all the tests are true except the fourth one. Please help! import java.util.*; public class Program { public static void main(String[] args) { Scanner inp = new Scanner(; String floor = inp.nextLine().replace("x"," "); int count=0; if(floor.contains("T") == false){ System.out.println("quiet"); }else if(floor.contains("$T") || floor.contains("T$")){ System.out.println("ALARM"); } else{ System.out.println("quiet"); } } }

7/2/2020 6:10:17 PM


3 Answers

New Answer


Thanx man it worked


You are replacing x with a space then it's no use to do that, replace with empty character "", And it is security problem not secret message i think... First if condition, according to input is always fails because all inputs contains T, no harm in code but no use...


What do you need the count for?