89-gray-code

DevGod
Vtuber
/** * @param {number} n * @return {number[]} */var grayCode = function(n) { let ans = []; for(let I = 0; I<1<<n; I++){ ans.push( I^ (I>>1) ); } return ans;};
/** * @param {number} n * @return {number[]} */var grayCode = function(n) { let ans = []; for(let I = 0; I<1<<n; I++){ ans.push( I^ (I>>1) ); } return ans;};