import java.util.HashSet; import java.util.Locale; import java.util.Scanner; import java.util.Set; public class StrongPassword { public static void main(String[] args) { try(Scanner in = new Scanner(System.in)){ in.useLocale(Locale.ENGLISH); Set numbers = toSet("0123456789".toCharArray()); Set lower_case = toSet("abcdefghijklmnopqrstuvwxyz".toCharArray()); Set upper_case = toSet("ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray()); Set special_characters = toSet("!@#$%^&*()-+".toCharArray()); int n = in.nextInt(); char[] pwd = in.next().toCharArray(); boolean number = false; boolean lower = false; boolean upper = false; boolean special = false; for (int i=0; i toSet(char[] numbers) { Set numbersSet = new HashSet<>(); for (char number : numbers) { numbersSet.add(number); } return numbersSet; } }