From 94288941574543c2715ee6260fa066bff2d19e95 Mon Sep 17 00:00:00 2001 From: choiminji Date: Thu, 10 Sep 2026 22:38:20 +0900 Subject: [PATCH] 0910 --- .../\354\265\234\353\257\274\354\247\200/3314.py" | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 "leetcode3/\354\265\234\353\257\274\354\247\200/3314.py" diff --git "a/leetcode3/\354\265\234\353\257\274\354\247\200/3314.py" "b/leetcode3/\354\265\234\353\257\274\354\247\200/3314.py" new file mode 100644 index 00000000..cc5751fa --- /dev/null +++ "b/leetcode3/\354\265\234\353\257\274\354\247\200/3314.py" @@ -0,0 +1,15 @@ +class Solution: + def minBitwiseArray(self, nums: List[int]) -> List[int]: + ans = [] + for n in nums: + if n % 2 == 0: + ans.append(-1) + else: + # 10 || 01 = 11 + # 100 || 101 = 101 + # 110 || 111 = 111 + for x in range(n): + if (x | (x+1)) == n: + ans.append(x) + break + return ans