EASY C++ SOLUTION
Intuition\nBY MULTIPLYING NUMBER BY 2 WILL INCREASE ITS VALUE SO RATHER THAN INCREASING DIFFERNT NUMBERS IN AN ARRAY , WE SHOULD INCREASE INDIVIDUAL NUMBER AND 
# Intuition\nBY MULTIPLYING NUMBER BY 2 WILL INCREASE ITS VALUE SO RATHER THAN INCREASING DIFFERNT NUMBERS IN AN ARRAY , WE SHOULD INCREASE INDIVIDUAL NUMBER AND TAKE MAX OF THEM WHICH WILL PROVIDE US WITH MAXIMUM OR VALUE.\n\n# Approach\nPREFIX, SUFFIX OR \n\n# Complexity\n- Time complexity:\nO(N)\n\n- Space complexity:\nO(N)\n\n# Code\n```\nclass Solution {\npublic:\n    #define ll long long int \n    long long maximumOr(vector<int>& arr, int k) {\n        int n=arr.size();\n        vector<ll>pre(n+1,0);\n        pre[0]=arr[0];\n        ll ans=0;\n        for(int i=1;i<n;i++){\n            pre[i]= pre[i-1] | arr[i];\n            ans|=arr[i];\n        }\n        vector<ll>suff(n+1,0);\n        suff[n-1]=arr[n-1];\n        for(int i=n-2;i>=0;i--){\n            suff[i] =suff[i+1]|  arr[i];\n        }\n        \n    for(int i=0;i<n;i++){\n        if(i==0){\n            ll xx = suff[1];\n            ll yy = arr[i] * pow(2,k);\n        xx|=yy;\n            ans = max(ans,xx); \n        }\n        else if(i==n-1){\n        ll xx = pre[n-2];\n        ll yy = arr[i] * pow(2,k);\n            xx|=yy;\n            ans=max(ans,xx);\n        }\n        else {\n            ll xx = pre[i-1];\n            ll yy = suff[i+1];\n            ll zz = arr[i] * pow(2,k);\n            xx = xx | yy | zz;\n            ans=max(ans,xx);\n        }\n    }\n        return  ans;\n        \n    }\n};\n```
['C++']