Solución
solution.tsTypeScript
public class Solution {
public int commonChars(String a, String b) {
if(a.isBlank() || b.isBlank()) return 0;
String na = a.toLowerCase();
String nb = b.toLowerCase();
int cant = 0;
for(int i = 0; i < na.length(); i++){
boolean vista = false;
for(int j = 0; j < i; j++){
if(na.charAt(i) == na.charAt(j)){
vista = true;
}
}
if(!vista){
for(int j = 0; j < nb.length(); j++){
if(na.charAt(i) == nb.charAt(j)){
cant++;
break;
}
}
}
}
return cant;
}
}0respuestas