Simple C++ solution with detailed explanation for noobs
\nclass Solution {\npublic:\n    //we only need to considder power of 2s in increasing order\n    //we check if input contain 1, 2, 4, 8, 16...\n    //why don\'
```\nclass Solution {\npublic:\n    //we only need to considder power of 2s in increasing order\n    //we check if input contain 1, 2, 4, 8, 16...\n    //why don\'t we need to check numbers in between, like (5,6,7) between 4 and 8?\n    //because those numbers can be formed by previous power of 2s.\n    //for exampe, when we already have 1,2 and 4, 5(101) can be formed by 4 | 1, 6(110) = 4 | 2, 7(111) = 4 | 2 | 1.\n    //thus, we only need to look for the next greater power of 2s as all numbers before it are guaranteed expressible.\n    int minImpossibleOR(vector<int>& nums) {\n        //sort input array for faster checking\n        sort(nums.begin(),nums.end());\n        //x is power of 2, start with 2^0 = 1;\n        int x = 1;\n        for(auto &i: nums){\n            if(i==x){\n                x <<= 1;\n            }\n        }\n        return x;\n    }\n};\n```
[]