[Python 3] Prefix Suffix
\nclass Solution:\n    def maximumOr(self, nums: List[int], k: int) -> int:\n        bitwiseOr = lambda x, y: x | y\n        \n        forward = list(accumulate
```\nclass Solution:\n    def maximumOr(self, nums: List[int], k: int) -> int:\n        bitwiseOr = lambda x, y: x | y\n        \n        forward = list(accumulate(nums, bitwiseOr))\n        backward = list(accumulate(nums[ : : -1], bitwiseOr))[ : : -1]\n        \n        forward = [0] + forward[ : -1]\n        backward = backward[1 : ] + [0]\n        \n        res = 0\n        \n        for i in range(len(nums)):\n            total = forward[i] | backward[i]\n            t = nums[i] * pow(2, k)\n            \n            res = max(res, total | t)\n        \n        return res\n```
['Bit Manipulation', 'Prefix Sum', 'Python', 'Python3']