Easy C++ Solution
\n\n# Code\n\nclass Solution {\npublic:\n    long long maximumOr(vector<int>& nums, int k) {\n        long long ans = 0;\n        long long aur = 0;\n        ve
\n\n# Code\n```\nclass Solution {\npublic:\n    long long maximumOr(vector<int>& nums, int k) {\n        long long ans = 0;\n        long long aur = 0;\n        vector<int> setbit(34, 0);\n        for (int j = 0; j < nums.size(); j++){\n            aur |= nums[j];\n            int count = 0;\n            int temp = nums[j];\n            while(temp){\n                if(temp % 2){\n                    setbit[count]++;\n                }\n                temp /= 2;\n                count++;\n            }\n        }\n        for (int i = 0; i < nums.size(); i++){\n            long long orr = aur;\n            long long x = nums[i] * pow(2, k);\n            int count = 0;\n            int temp = nums[i];\n            while(temp){\n                if(temp % 2){\n                    if(setbit[count] == 1){\n                        orr ^= (long long)pow(2, count);\n                    }\n                }\n                temp /= 2;\n                count++;\n            }\n            orr |= x;\n            ans = max(ans, orr);\n        }\n        return ans;\n    }\n};\n```
['C++']