function solution(arr) { // 1 const GCD = (a, b) => b > 0 ? GCD(b, a % b) : a // 2 return arr.reduce((acc, cur) => acc * cur / GCD(acc, cur), 1) }