Untitled
unknown
plain_text
2 years ago
585 B
6
Indexable
function Solution(S){
const N = S.length;
const M = S[0].length;
let result = new Array();
let found = false;
if (S.length === 0){
result =[];
};
for (let i =0; i < N; i++){
for (let j = i + 1; j <N; j++){
for(let k =0; k < M; k++){
if (S[i][k] === S[j][k]){
result = [i, j, k];
found = true;
break;
}
}
if(found) break;
}
if(found) break;
}
return result;
}Editor is loading...
Leave a Comment