import java.util.*;
class Solution {
public int[] solution(int[] answers) {
int[][] mathFail = new int[][] {{1,2,3,4,5}, {2,1,2,3,2,4,2,5}, {3,3,1,1,2,2,4,4,5,5}};
int[] score = new int[3];
for(int i=0; i<3; i++) {
for(int j=0; j<answers.length; j++) {
int index = j%mathFail[i].length;
if(answers[j]==mathFail[i][index]) { score[i]++; }
}
}
int max = Math.max(score[0], Math.max(score[1], score[2]));
List<Integer> list = new ArrayList<>();
for(int i=0; i<3; i++) {
if(max==score[i]) { list.add(i+1); }
}
int[] answer = new int[list.size()];
for(int i=0; i<answer.length; i++) { answer[i] = list.get(i); }
return answer;
}
}