C++ Easy Solution
Code\n\nclass Solution {\npublic:\n    long long solve(int n,int k) {\n        long long num = n;\n        while(k-- > 0)\n            num *= 2;\n        return
# Code\n```\nclass Solution {\npublic:\n    long long solve(int n,int k) {\n        long long num = n;\n        while(k-- > 0)\n            num *= 2;\n        return num;\n    }\n    long long maximumOr(vector<int>& nums, int k) {\n        int n = nums.size();\n        vector<int> suff(n,0);\n        for(int i = n-2;i >= 0;i--) {\n            suff[i] = suff[i+1] | nums[i+1]; \n        }\n        long long ans = 0;\n        long long pre = 0;\n        for(int i = 0;i < n;i++) {\n            long long a = pre | solve(nums[i],k) | suff[i];\n            pre = pre | nums[i];\n            ans = max(ans,a);\n        }\n        return ans;\n    }\n};\n```
['Prefix Sum', 'C++']