function LastRemaining_Solution(n, m) { // write code here let nums = new Array(n).fill(0).map((_,index)=>index); console.log(nums) while(nums.length > 1){ let index = m % nums.length? (m % nums.length)-1 :nums.length-1; nums = [...nums.slice(index+1),...nums.slice(0,index)]; console.log(index...