function solution(num){
let result = [];
for(let i = 1; i<num; i++)
if(num % i == 1){
result += i+',';
result = parseInt(result);
if(result>0){
return result;
}
}
}
solution(12)
function solution(n) {
let answer = 0;
for (let i = 0; i < n; i++) {
if (answer > 0) {
break;
}
if (n % i == 1) {
answer = i;
}
}
return answer;
}