function solution(n, m) { let answer = [0, 0]; for(let i = 1; i <= m; i++){ if(n % i == 0 && m % i == 0){ answer[0] = i; answer[1] = i * (n / i) * (m / i); } } return answer; }
성공