kFor=cache(lambda v:k)
```python3 []
class Solution:
    def minBitwiseArray(self, nums: List[int]) -> List[int]:
        kFor=cache(lambda v:k)
        k=-1;kFor(2)
        for k in range(max(nums)):kFor(k|(k+1))
        return [kFor(v)for v in nums]
```
['Python3']