문제
나의 생각
2중 for문에 대한 이해도와 문자열 비교시 equals 메소드를 사용한다는 것을 안다면 쉽게 풀수 있는 문제라고 생각.
나의 답안
public static int solution(String[] s1, String[] s2) {
int answer = 0;
for(int i = 0 ; i < s1.length ; i++) {
for (int j = 0 ; j < s2.length; j++){
if (s1[i].equals(s2[j])){
answer++;
}
}
}
return answer;
}