[java] 프로그래머스 - 배열의 유사도

세상을 바꾸는 개발자·2023년 3월 19일
0

[문제링크 - 프로그래머스 - 배열의 유사도] https://school.programmers.co.kr/learn/courses/30/lessons/120903

class Solution {
    public 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;
    }
}
profile
초심 잃지 않기

0개의 댓글