BEATS 100% | O(n) TIME COMPLEXITY |  O(n) SPACE COMPLEXITY | PYTHON | BIT MANIPULATION
Complexity\n- Time complexity:\nO(n) because we iterate through all numbers.\n\n- Space complexity:\nO(1)\n\n# Code\npython3 []\nclass Solution:\n    def minBit
# Complexity\n- Time complexity:\n$$O(n)$$ because we iterate through all numbers.\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```python3 []\nclass Solution:\n    def minBitwiseArray(self, nums: List[int]) -> List[int]:\n        ans = []\n\n        for n in nums:\n            if n == 2: # 10 (it\'s exactly this prime integer ending in 0)\n                ans.append(-1)\n                continue\n            \n            counter = 0 # maximum digit of a number that can be removed (to minimise each value ans[i])\n            # 100011 -> 100001 OR (100001 + 1) \n            #     100001\n            #  OR 100010 (next digit of a number)\n            #     -------\n            #     100011\n            # 1001 -> 1000 OR (1000 + 1)\n            # 10111 -> 10011 OR (1011 + 1)\n            \n            num = n\n\n            while n & 1 == 1:\n                n >>= 1\n                counter += 1\n\n            ans.append(num - 2 ** (counter - 1))\n\n        return ans\n```
['Bit Manipulation', 'Python3']