import java.util.*;
class Solution {
public int solution(String str1, String str2) {
ArrayList<String> set1 = new ArrayList<>();
ArrayList<String> set2 = new ArrayList<>();
str1 = str1.toUpperCase();
str2 = str2.toUpperCase();
List<String> inter = new ArrayList<>();
List<String> union = new ArrayList<>();
// START 여기서
for(int i=0; i<str1.length()-1; i++){
String cur = str1.substring(i,i+2);
if(cur.matches("^[a-zA-Z]*$")){
set1.add(cur);
}
}
for(int i=0; i<str2.length()-1; i++){
String cur = str2.substring(i,i+2);
if(cur.matches("^[a-zA-Z]*$")){
set2.add(cur);
}
}
int interSize = 0;
for(String subStr1:set1){
if(set2.remove(subStr1)){
inter.add(subStr1);
interSize++;
}
}
// END 여기까지 핵심로직
int unionSize = set2.size()+set1.size();
if(unionSize == 0 ) return 65536;
double ratio = (double) interSize / (double) unionSize;
System.out.println(ratio+" "+ interSize+" "+unionSize);
System.out.println(set1+"\n"+set2);
int answer = (int) (65536*ratio);
return answer;
}
}