In Java, I have two ArrayLists:
A = [Ab, cd, df, FE, ...]
B = [ab, cde, de, fE, ...]
If the lists are a little big, the brute force method is very slow:
for(String a : A) {
for(String b : B) {
if(a.equalsIgnoreCase(b)) {
System.out.println("duplicate: " + a "->" + b);
}
}
}
What's the best way to make it faster, but not super complicated to implement?