강의로 돌아가기

### 어디가 문제인지 모르겠는데... 어디서 예외가 발생하는 걸까요

``````import java.util.ArrayList;
import java.util.List;

class Solution {

public int solution(String str1, String str2) {

str1 = str1.toUpperCase();
str2 = str2.toUpperCase();

List<String> ary1 = make(str1);
List<String> ary2 = make(str2);

int size1 = ary1.size();
int size2 = ary2.size();

if(ary1.isEmpty() && ary2.isEmpty()) return 65536;

int inter = intersection(ary1, ary2);
int uni = size1 + size2 - inter;

double jakard = (double)inter /uni;

return (int)(jakard * 65536);

}

private int intersection(List<String> ary1, List<String> ary2){

List<String> list1 = new ArrayList<>();
List<String> list2 = new ArrayList<>();

for(int i = 0; i < ary1.size(); i++){
if(ary2.contains(ary1.get(i)))
}

for(int i = 0; i < ary2.size(); i++){
if(ary1.contains(ary2.get(i)))
}

return Math.min(list1.size(),list2.size());

}//end of solve

private List<String> make(String s){

List<String> list = new ArrayList<>();

for(int i = 0; i < s.length() - 1; i++){

String temp = s.substring(i,i + 2);
char first = temp.charAt(0);
char second = temp.charAt(1);

if(first >= 'A' && first <= 'Z' && second >= 'A' && second <= 'Z')