One line solution. Bit manipulation. O(n)
\nclass Solution:\n    def minBitwiseArray(self, nums: List[int]) -> List[int]:\n        return [(n&(n+1)) | ((~n&(n+1))//2-1) for n in nums]\n
```\nclass Solution:\n    def minBitwiseArray(self, nums: List[int]) -> List[int]:\n        return [(n&(n+1)) | ((~n&(n+1))//2-1) for n in nums]\n```
['Bit Manipulation', 'Python3']