https://programmers.co.kr/learn/courses/30/lessons/42840
func solution(_ answers:[Int]) -> [Int] {
var student = [1:0,2:0,3:0]
let firstStutdend = [1, 2, 3, 4, 5]
let secondStutdend = [2, 1, 2, 3, 2, 4, 2, 5]
let thirdStutdent = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5]
for i in 0..<answers.count {
if firstStutdend[i % 5] == answers[i] {
student[1]! += 1
}
if secondStutdend[i % 8] == answers[i] {
student[2]! += 1
}
if thirdStutdent[i % 10] == answers[i] {
student[3]! += 1
}
}
let answer = student.filter{$0.value == student.values.max() }.map {$0.key}.sorted()
return answer
}