[프로그래머스/완전탐색/javascript] 모의고사 코드 및 설명
다른 분 코드 보면서 이해하고 배운 내용을 작성해보자. 문제 정답 처리된 코드 function solution(answers) { let pattern = [ [1,2,3,4,5], [2,1,2,3,2,4,2,5], [3,3,1,1,2,2,4,4,5,5] ]; let count = [0, 0, 0]; for(let i in answers){ if(pattern[0][i%5] === answers[i]){ count[0]++; } if(pattern[1][i%8] === answers[i]){ count[1]++; } if(pattern[2][i%10] === answers[i]){ count[2]++; } } let max = Math.max(...count); let answer=[]; for(let ..