Simple Solution | Beats 100% ✅ | C++
Intuition\n- Power of 2 numbers can be formed by setting only one bit.\n- Therefore least Power of 2 number that is not present in the array is not expressible.
# Intuition\n- `Power of 2` numbers can be formed by setting only one bit.\n- Therefore least `Power of 2` number that is not present in the array is not expressible.\n\n# Approach\n1. Use `x` as a map to store power of 2 numbers present in the array i.e) `i` th bit of `x` denotes if `2^i` is present in the array.\n2. Populate `x` by iterating the array and finding the `Power of 2` numbers using `n & (n-1)`.\n3. Find the least significant bit `i` of `x` that is `0` and return `2^i`.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minImpossibleOR(vector<int>& nums) {\n        int x = 0;\n        for (int& n : nums) {\n            if ((n & (n - 1)) == 0) {\n                x |= n;\n            }\n        }\n        int i = 0;\n        while (x) {\n            if ((x & 1) == 0) {\n                break;\n            }\n            i++;\n            x >>= 1;\n        }\n\n        return 1 << i;\n    }\n};\n```
['Bit Manipulation', 'Brainteaser', 'C++']