Could you please help me in debugging the code, as this is not passing all the test cases (although according to dry run it is running fine)
import java.util.*;
public class Main {
public static void main (String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String s[] = new String[n];
String strin = new String();
for(int i = 0;i<n;i++){
s[i] = sc.next();
strin = strin + s[i];
}
String c[] = strin.split("");
HashSet set = new HashSet<>();
n = c.length;
for(int i = 0;i<n;i++){
if(!set.contains(c[i])){
set.add(c[i]);
}
}
System.out.print(set.size());
}
}