Easiest O(N) solution
Intuition\nThe first power of 2 will be the answer for sure as it cannot be formed unless we have 1 for the most significant bit position!\n\n# Approach\n1. Add
# Intuition\nThe first power of 2 will be the answer for sure as it cannot be formed unless we have 1 for the most significant bit position!\n\n# Approach\n1. Add all elements of nums to the set\n2. Loop over each power of two and check it it exists\n3. If it does not, it is the answer\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\n    public:\n        int minImpossibleOR(vector<int>& nums) {\n            unordered_set<int> set;\n            for (int num: nums)set.insert(num);\n\n            int ans = 1;\n            while (set.find(ans) != set.end()) ans *= 2;\n            return ans;\n        }\n};\n```
['C++']