[Python] brutal force solution that beat 90%
\nclass Solution:\n    def minBitwiseArray(self, nums: List[int]) -> List[int]:\n        # build a map from value to index to easy access answer list\n        n
```\nclass Solution:\n    def minBitwiseArray(self, nums: List[int]) -> List[int]:\n        # build a map from value to index to easy access answer list\n        num_map = collections.defaultdict(list)\n        for idx, n in enumerate(nums):\n            num_map[n].append(idx)\n        \n        ans = [-1] * len(nums)\n        max_num = max(nums)\n        \n        for i in range(1, max_num):\n            val = i | (i + 1)\n            if val in num_map and ans[num_map[val][0]] == -1:\n                for tidx in num_map[val]:\n                    ans[tidx] = i\n        \n        return ans\n```
['Python3']