function solution(str1, str2) {
let answer = 0;
// toLowerCase로 소문자로 만든 후 배열로변경
str1 = str1.toLowerCase().split('');
str2 = str2.toLowerCase().split('');
let temp1 = [];
let temp2 = [];
// str들 2개씩 자른 후, 영어 소문자면 temp에 저장
const getStr = (arr, temp) => {
arr.map((el, i) => {
let check = arr.slice(i, i+2).join('');
if(check.match(/[a-z]{2}/)) temp.push(check);
});
}
getStr(str1, temp1);
getStr(str2, temp2);
// all은 전체 집합 수, interSection은 교집합
// 후에 union은 합집합
let all = temp1.length+temp2.length;
let interSection = [];
// 2개씩 자른 값이 옆의 2개씩 자른 값에 있다면
// 중복을 방지하기 위해 splice를 이용해 제거하기
// teseCase 5, 9, 10, 11 이 중복 문제 때문임
for(let i of temp1){
if(temp2.includes(i)) {
interSection.push(i);
let check = temp2.indexOf(i);
temp2.splice(check,1)
}
}
let interLen = interSection.length;
let unionLen = all - interLen;
return answer = isNaN(interLen/unionLen) ? 65536 : Math.floor(interLen/unionLen*65536);
}