Simple python3 solution | 515 ms - faster than 100.00% solutions
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n``` python3 []\nclass Solution:\n    def maximumOr(self, nums: List[int], k: int) -> int:\n        suffix_stack = [0]\n        for elem in reversed(nums):\n            suffix_stack.append(suffix_stack[-1] | elem)\n        suffix_stack.pop()\n        \n        prefix = result = 0\n        for elem in nums:\n            current = prefix | suffix_stack.pop() | elem << k\n            result = max(result, current)\n            prefix |= elem\n        return result\n\n```
['Greedy', 'Bit Manipulation', 'Prefix Sum', 'Python3']