function solution(test) {
let answer = [];
for (let i = 0; i < test.length; i++) {
for (let j = 0; j < test[i].length - 1; j++) {
for (let k = j + 1; k < test[i].length; k++) {
if (answer.includes(`${test[i][j]},${test[i][k]}`)) continue;
if (answer.includes(`${test[i][k]},${test[i][j]}`)) {
answer.splice(answer.indexOf(`${test[i][k]},${test[i][j]}`), 1);
continue;
}
if (i !== 0) continue;
answer.push(`${test[i][j]},${test[i][k]}`);
}
}
}
return answer;
}