function solution(relation) {
var answer = new Set();
let number=1<<relation[0].length;
for(let i=1;i<number;i++){
let a=relation.map(e=>e.filter((f,idx)=>i&(1<<idx)).join(''));//i랑 1<<idx가 같은 거 만 모아
const set =new Set(a);
console.log(i,a);
if(set.size===a.length)answer.add(i);
}
for(let i of answer){
for(let j of answer){
if(i>=j)continue;
if((i&j)===i)answer.delete(j);
}
}
return answer.size;
}