diff --git "a/leetcode3/\355\231\251\354\235\200\354\247\200/1861. Rotating the Box.js" "b/leetcode3/\355\231\251\354\235\200\354\247\200/1861. Rotating the Box.js" new file mode 100644 index 00000000..1230d22c --- /dev/null +++ "b/leetcode3/\355\231\251\354\235\200\354\247\200/1861. Rotating the Box.js" @@ -0,0 +1,9 @@ +/** + * @param {character[][]} boxGrid + * @return {character[][]} + */ +var rotateTheBox = function (boxGrid) { + const output = Array.from({ length: boxGrid[0].length }, () => + Array(boxGrid.length), + ); +}; diff --git "a/leetcode3/\355\231\251\354\235\200\354\247\200/3314. Construct the Minimum Bitwise Array I.js" "b/leetcode3/\355\231\251\354\235\200\354\247\200/3314. Construct the Minimum Bitwise Array I.js" new file mode 100644 index 00000000..7a5545fc --- /dev/null +++ "b/leetcode3/\355\231\251\354\235\200\354\247\200/3314. Construct the Minimum Bitwise Array I.js" @@ -0,0 +1,21 @@ +/** + * @param {number[]} nums + * @return {number[]} + */ +var minBitwiseArray = function(nums) { + const arr=Array(1000).fill(-1); + const max=Math.max(...nums); + + for(let num=0;num<=max;num++){ + const afterOr=num|(num+1); + if(arr[afterOr]===-1) arr[afterOr]=num; + } + + const result=Array(nums.length); + for(let i=0;i