Simple Python3 Solution
Basically what we need to do is to find the where the consecutive 1 ends from the end of the binary presentation of the target and then construct the number\n\n
Basically what we need to do is to find the where the consecutive 1 ends from the end of the binary presentation of the target and then construct the number\n\nFor example:\ntarget = 11111000111111\nres     ~~= 11111000011111\n\nas adding 1 in res yield to 11111000100000 which contributes to the only missing 1 in the target\n\n# Code\n```python3 []\nclass Solution:\n    def minBitwiseArray(self, nums: List[int]) -> List[int]:\n        res = []\n        for element in nums:\n            if element == 2:\n                res.append(-1)\n            else:\n                bin_rep = bin(element)[2:]\n                if bin_rep[-2] == \'0\':\n                    res.append(int(bin_rep[:-1] + \'0\',2))\n                else:\n                    index = None\n                    for i in range(len(bin_rep)-2, -1, -1):\n                        if bin_rep[i] == \'0\':\n                            break\n                        else:\n                            index = i\n                    res.append(int(bin_rep[:index] + \'0\' + \'1\'*(len(bin_rep) - index - 1),2))\n        return res\n        \n```
['Python3']