int stringsCrossover(String[] inputArray, String result) {
int c=0;
for (int i=0; i<inputArray.length-1; i++) {
for (int j=i+1; j<inputArray.length; j++) {
if (match(inputArray[i], inputArray[j], result)) {
c++;
}
}
}
return c;
}
boolean match(String s1, String s2, String result) {
for (int i=0; i<result.length(); i++) {
if (result.charAt(i)!=s1.charAt(i) && result.charAt(i)!=s2.charAt(i)) {
return false;
}
}
return true;
}
Solucion de manuel para Strings Crossover
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.