import java.util.Arrays;
public class Solution {
public int[] solution(int[] lottos, int[] win_nums) {
int zeroCount = 0;
Arrays.sort(lottos);
Arrays.sort(win_nums);
for (int t : lottos) {
if (t == 0) {
zeroCount++;
continue;
} else {
break;
}
}
int winCount = 0;
int myIdx = 0;
int winIdx = 0;
while (true) {
if (lottos[myIdx] == win_nums[winIdx]) {
winCount++;
myIdx++;
winIdx++;
} else if (lottos[myIdx] > win_nums[winIdx]) {
winIdx++;
} else if (lottos[myIdx] < win_nums[winIdx]) {
myIdx++;
} else {
throw new RuntimeException("LOGIG ERROR");
}
if ((myIdx >= 6) || (winIdx >= 6)) {
break;
}
}
int[] answer = new int[2];
answer[0] = countToRank(zeroCount + winCount);
answer[1] = countToRank(winCount);
return answer;
}
private int countToRank(int count) {
if (count >= 2) {
return 7 - count;
} else {
return 6;
}
}
public static void main(String[] args) {
Solution s = new Solution();
int[] ret = s.solution(new int[]{44, 1, 0, 0, 31, 25}, new int[]{31, 10, 45, 1, 6, 19});
System.out.println(Arrays.toString(ret));
}
}