Solution :-|
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)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\nclass Solution {\npublic:\n    long long maximumOr(vector<int>& nums, int k) {\n        long long n=nums.size(),maxi=LONG_LONG_MIN;\n        vector<long long>pre(nums.size()),suf(nums.size());\n        pre[0]=nums[0];suf[suf.size()-1]=nums[nums.size()-1];\n        for(long long i=1;i<n;i++){\n            pre[i]=pre[i-1]|nums[i];\n        }\n        for(long long i=n-2;i>=0;--i){\n            suf[i]=suf[i+1]|nums[i];\n        }\n        long long mask=(1<<k);\n        for(long long i=0;i<n;i++){\n            long long x=nums[i]*mask;\n            if(i-1>-1){\n                x|=pre[i-1];\n            }\n            if(i+1<n){\n                x|=suf[i+1];\n            }\n            maxi=max(maxi,x);\n        }\n        return maxi;\n    }\n};\n```
['C++']