C++, simple, It can only be powers of 2
Intuition\nJust note:\n1. Any powers of two cannot be ORs of any other guys.\n2. If we have all the powers of 2 below $2^N$, then all the numbers smaller than $
# Intuition\nJust note:\n1. Any powers of two cannot be ORs of any other guys.\n2. If we have all the powers of 2 below $2^N$, then all the numbers smaller than $2^N$ can be expressed, by use of ONLY $2^n, n \\leq N$. \n\n# Approach\nJust go through all the powers of two in the range of integer, and find the first one that has not been appeared.\n\n# Complexity\n\n- Time complexity: $O(NlogN)$\n\n- Space complexity: $O(1)$\n\n# Code\n```\nstatic const auto bin_powers = [](){\n    array<int, 31> arr;\n    for (int i = 0; i < 31; ++i) {\n        arr[i] = 1 << i;\n    }\n    return arr;\n}();\n\nclass Solution {\npublic:\n    int minImpossibleOR(vector<int>& nums) {\n        sort( nums.begin(), nums.end() );\n        const auto max_bin_power = nums.back();\n        // auto it = lower_bound( bin_powers.begin(), bin_powers.end(), max_bin_power );\n        \n        // if( *it == max_bin_power ){\n        //     return *(++it);\n        // }\n        // return *it;\n        for (int i = 0; i < 31; ++i) {\n            auto [beg, end] = equal_range( nums.begin(), nums.end(), bin_powers[i] );\n            if( beg == end ) {\n                return bin_powers[i];\n            }\n        }\n        return 0;\n    }\n};\n\n```
['C++']