2680. Maximum OR
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def maximumOr(self, A: List[int], k: int) -> int:
        max_result, left_accum, n = 0, 0, len(A)
        right_accum = [0] * n
        for i in range(n - 2, -1, -1):
            right_accum[i] = right_accum[i + 1] | A[i + 1]
        for i in range(n):
            max_result = max(max_result, left_accum | (A[i] << k) | right_accum[i])
            left_accum |= A[i]
        return max_result

```
['Python3']