Solución
solution.tsTypeScript
function wordInMatrix(matrix: string[][], word: string): boolean {
let rowComparator: string = "";
for (let i: number = 0; i < matrix.length; i++) {
rowComparator += matrix[i][0];
let columnComparator: string = "";
for (let j: number = 0; j < matrix[0].length; j++) {
columnComparator += matrix[i][j];
}
if (rowComparator === word || columnComparator === word) return true;
}
return false;
}
// No modificar: necesario para evaluar el resultado.
export { wordInMatrix };0respuestas