문제
onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=29&page=show_problem&problem=36
let a = 900;
let b = 1000;
let max = 0;
for(let i = a; i<= b; i++){
let n = i;
let arr = [];
arr.push(n);
while(true){
if(n % 2 === 0){
n = n / 2;
}else{
n = n * 3 + 1;
}
arr.push(n);
if(n === 1){
break;
}
}
if(max < arr.length){
max = arr.length;
}
}
console.log(max);