From a4afdc93a62e8326a4f0cf5c4466949d245fb988 Mon Sep 17 00:00:00 2001 From: dmswl6310 Date: Thu, 10 Sep 2026 22:44:28 +0900 Subject: [PATCH] 0910 --- .../1861. Rotating the Box.js" | 9 ++++++++ ... Construct the Minimum Bitwise Array I.js" | 21 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 "leetcode3/\355\231\251\354\235\200\354\247\200/1861. Rotating the Box.js" create mode 100644 "leetcode3/\355\231\251\354\235\200\354\247\200/3314. Construct the Minimum Bitwise Array I.js" 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