EASY C++ SOLUTION ||PREFIX METHOD
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(n) overall\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(n)\n\n# Code\n```\nclass Solution {\npublic:\n    long long maximumOr(vector<int>& nums, int k) {\n        int n=nums.size();\n        long long p[n + 1], s[n + 1];\n\xA0\xA0\xA0     long long so, pow = 1;\n\xA0\xA0\xA0\xA0 for (int i = 0; i < k; i++){\n\xA0\xA0\xA0\xA0\xA0\xA0\xA0 pow*=2;\n\xA0\xA0\xA0\xA0 }\n\n\xA0\xA0\xA0 p[0] = 0;\n\xA0\xA0\xA0 for (int i = 0; i < n; i++){\n\xA0\xA0\xA0\xA0\xA0\xA0\xA0 p[i + 1] = p[i] | nums[i];\n\xA0\xA0\xA0 }\n\xA0\xA0\xA0\xA0 s[n] = 0;\n\xA0\xA0\xA0 for (int i = n - 1; i >= 0; i--){\n\xA0\xA0\xA0\xA0\xA0\xA0\xA0 s[i] = s[i + 1] | nums[i];\n\xA0\xA0\xA0 }\n\xA0\xA0\xA0\xA0 so= 0;\n\xA0\xA0\xA0 for (int i = 0; i < n; i++)\n\xA0\xA0\xA0\xA0\xA0\xA0\xA0 so = max(so, p[i] | (nums[i] * pow) | s[i + 1]);\n\n\xA0\xA0\xA0 return so;\n    }\n};\n```
['C++']