DP+Slide Window
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
```csharp []
public class Solution {
    public long MaximumOr(int[] nums, int k) {
        int len = nums.Length;
        long[] leftOr = new long[len], rightOr = new long[len];
        long maxOr = 0;
        for(int i = 1; i < len; i++)
        {
            leftOr[i] = leftOr[i-1]|nums[i-1];
        }

        for(int i = len-2; i >= 0; i--)
        {
            rightOr[i] = rightOr[i+1]|nums[i+1];
        }

        int times = (int)Math.Pow(2, k);
        for(int i = 0; i < len; i++)
        {
            long cur = (long)nums[i]*times;
            cur |= leftOr[i];
            cur |= rightOr[i];
         //   Console.WriteLine($"{i}th, cur is {cur}, leftOr is {leftOr[i]}, rightOr is {rightOr[i]}");
            maxOr = Math.Max(maxOr, cur);
        }

        return maxOr;
    }
}
```
['C#']