Python simple greedy O(n) Time O(1) Memory
\n\n# Code\n\nclass Solution:\n    def maximumOr(self, nums: List[int], k: int) -> int:\n        cur = 0\n        saved = 0\n        for num in nums:\n         
\n\n# Code\n```\nclass Solution:\n    def maximumOr(self, nums: List[int], k: int) -> int:\n        cur = 0\n        saved = 0\n        for num in nums:\n            saved |= num & cur\n            cur |= num\n        \n        max_num = 0\n        \n        for num in nums:\n            max_num = max(max_num, saved | (cur & ~num) | num << k)\n        return max_num\n        \n\n```
['Greedy', 'Python3']