[SOLVED] Does anyone know why my code is failing the test cases 10 and 11 (password validation)
Does anyone know why the code is failing test cases #10/11 or what their input is? import java.util.Scanner; public class Program { public static void main(String[] args) { int numberOfSpecialLetters = 0; int numberOfNumbers = 0; String[] specialLetters = { "!", "@", "#", "$", "%", "&", "*" }; String[] numbers = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; Scanner in = new Scanner(System.in); String password = in.nextLine(); int length = password.length(); for (String specialLetter : specialLetters) { if (password.contains(specialLetter)) { numberOfSpecialLetters++; } } for (String number : numbers) { if (password.contains(number)) { numberOfNumbers++; } } if (numberOfSpecialLetters >= 2 && numberOfNumbers >= 2 && length >= 7) { System.out.println("Strong"); } else { System.out.println("Weak"); } } }