풀이 시간 : 38분
import java.util.*;
class Solution {
public int[] solution(int[] lottos, int[] win_nums) {
int[] answer = new int[2];
int[] rank = {6, 6, 5, 4, 3, 2, 1};
int zeroCount = 0;
int matchCount = 0;
for (int num : lottos) {
if (num == 0) zeroCount++;
}
for (int num : lottos) {
for (int winNum : win_nums) {
if (num == winNum) {
matchCount++;
break;
}
}
}
answer[0] = rank[matchCount + zeroCount];
answer[1] = rank[matchCount];
return answer;
}
}