EASY CPP SOLUTION || USING PREFIX & SUFIX
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:\no(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    long long helper(long long value , int k){\n        while(k--){\n            value*=(long long) 2;\n        }\n        return (long long)value;\n    }\n    long long maximumOr(vector<int>& nums, int k) {\n       \n        int n = nums.size();\n        if(n == 1 ) return helper(nums[0],k);\n       \n        vector<int>prefix(n);\n        vector<int>sufix(n);\n\n        prefix[0] = nums[0];\n        sufix[n-1] = nums[n-1];\n\n        for(int i = 1 ; i<n; i++) \n            prefix[i] = (nums[i]) | prefix[i-1];\n        \n        for(int i = n-2 ; i>= 0 ; i--) \n            sufix[i] = (nums[i]) | sufix[i+1];\n      \n         long long maxi =  maxi = (helper(nums[0],k)) | sufix[1];\n         maxi = max((helper(nums[n-1],k)) | prefix[n-2] , maxi);     \n            \n        for(int i = 1 ; i< n - 1 ; i++)  \n             maxi = max(maxi, prefix[i-1] | sufix[i+1] |(helper(nums[i],k)) );\n        \n        return maxi;\n    }\n};\n```
['C++']