I have to write a program that counts the uniques characters in a String given by the user. For example \"abc\" returns 3 and \"aabbccd\" returns 4. I am not allow to use advan
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter String:");
int length = scanner.nextInt();
char[] ch1 = new char[length];
String[] input = new String[length];
for (int i = 0; i < length; i++) {
String userInput = scanner.next();
input[i] = userInput;
ch1= userInput.toCharArray();
Arrays.sort(ch1);
System.out.println(ch1);
}