BitMap Solution, Count the Bits, O(n) time, O(1) space
Intuition\n1)Go through each num in nums and add the bits that are 1s to the map.\n2)Go through each num in nums and remove the bits from num since we are going
# Intuition\n1)Go through each num in nums and add the bits that are 1s to the map.\n2)Go through each num in nums and remove the bits from num since we are going to shift this num by << k.(Bit Map is prefixSum)\n3)Add the new bits to the map from the shift << k.\n4)Now we create a bit string from the map. If the count of that bit is >0 then it is a "1" else "0".\n5)Turn the string to an int.\n6)Return the largest int we created!\n\n# Code\n```\nclass Solution:\n    def maximumOr(self, nums: List[int], k: int) -> int:\n        ans = 0\n        bitMap = [0] * 64\n        for num in nums:\n            for i in range(64):\n                bitMap[i] += (num>> i) & 1\n        for num in nums:\n            tempMap = bitMap.copy()\n            for i in range(64):\n                tempMap[i] -= (num>>i) & 1\n            curr = num * pow(2,k)\n            for i in range(64):\n                tempMap[i] += (curr>>i) & 1\n            newStr = ""\n            for i in range(64):\n                newStr+= "1" if tempMap[i] >= 1 else "0"\n            ans = max(ans, int(newStr[::-1],2))\n        return ans\n\n\n            \n\n\n        \n        \n```
['Python3']