function solution(answers) {
var answer = [];
var total1 = 0;
var total2 = 0;
var total3 = 0;
for(var i = 0; i < answers.length; i++) {
var index = i % 5
if(index == 0) {
answers[i] == 1 ? total1++ : total1;
} else if(index == 1) {
answers[i] == 2 ? total1++ : total1;
} else if(index == 2) {
answers[i] == 3 ? total1++ : total1;
} else if(index == 3) {
answers[i] == 4 ? total1++ : total1;
} else if(index == 4) {
answers[i] == 5 ? total1++ : total1;
}
var index2 = i % 8
if(index2 == 1) {
answers[i] == 1 ? total2++ : total2;
} else if (index2 == 3) {
answers[i] == 3 ? total2++ : total2;
} else if (index2 == 5) {
answers[i] == 4 ? total2++ : total2;
} else if (index2 == 7) {
answers[i] == 5 ? total2++ : total2;
} else {
answers[i] == 2 ? total2++ : total2;
}
var index3 = i % 10
if(index3 == 0 || index3 == 1) {
answers[i] == 3 ? total3++ : total3
} else if (index3 == 2 || index3 == 3) {
answers[i] == 1 ? total3++ : total3
} else if (index3 == 4 || index3 == 5) {
answers[i] == 2 ? total3++ : total3
} else if (index3 == 6 || index3 == 7) {
answers[i] == 4 ? total3++ : total3
} else if (index3 == 8 || index3 == 9) {
answers[i] == 5 ? total3++ : total3
}
}
var max = Math.max(total1, total2, total3)
if(total1 == max) {
answer.push(1)
}
if(total2 == max) {
answer.push(2)
}
if(total3 == max) {
answer.push(3)
}
answer.sort((a, b) => a - b)
return answer;
}