1var minMoves = function (target, maxDoubles) {2 if (maxDoubles === 0) return target - 1;3 let count = 0;45 while (target > 1) {6 if (target % 2 === 0 && maxDoubles > 0) {7 target /= 2;8 maxDoubles--;9 } else {10 target--;11 }1213 count++;14 }1516 return count;17};
WPM •0 •0
ACC •0 •0
TIME •0