function solution(arr) {
let answer=arr[arr.length-1];
arr=arr.sort();
let isLCM=false;
let index=1;
while(isLCM===false){
index+=1;
for (let i=1;i<arr.length;i++){
if ((arr[0]*index)%arr[i]===0){
isLCM=true;
}else{
isLCM=false;
break;
}
}
}
answer=arr[0]*index;
return answer;
}
이제 슬슬 어려운 문제로 복귀해야겠다..