You are viewing a single comment's thread. Return to all comments →
static boolean solve(int n2, int m2, char matrizX[][], char matrizY[][], int filaX) { ArrayList<String> valores = new ArrayList<>(); for (int i = 0; i < n2; i++)valores.add(pasarCadena(matrizY[i])); for (int i = 0; i <= filaX - n2; i++) { for (int j = 0; j <= matrizX[i].length - m2; j++) { boolean encontrado = true; for (int k = 0; k < n2; k++) { String subcadenaX = pasarCadena(Arrays.copyOfRange(matrizX[i + k], j, j + m2)); if (!subcadenaX.equals(valores.get(k))) { encontrado = false; break; } } if (encontrado)return true; } } return false; }
Seems like cookies are disabled on this browser, please enable them to open this website
The Grid Search
You are viewing a single comment's thread. Return to all comments →