Finding the Minimum Impossible OR Value Using Powers of Two | Using Set O(N)
IntuitionThe problem requires finding the smallest positive integer thatcannotbe obtained using the bitwise OR of any subset ofnums.
The key observation is that
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The problem requires finding the smallest positive integer that **cannot** be obtained using the bitwise OR of any subset of `nums`.  
- The key observation is that if all powers of `2` up to some `2^k` exist in `nums`, then we can form all numbers from `1` to `2^k - 1`.  
- The first missing power of `2` is the answer.
# Approach
<!-- Describe your approach to solving the problem. -->
1. Convert `nums` into a **set** for fast lookups (`O(1)` per check).  
2. Start from `1` (`2^0`) and keep doubling it (`1, 2, 4, 8, ...`).  
3. If a power of `2` is missing from `nums`, return it immediately.  
# Complexity
- Time complexity:O(**N**)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(**1**)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def minImpossibleOR(self, nums: List[int]) -> int:
        nums  = set(nums)
        min_power = 1
        while min_power in nums:
            min_power *= 2
        
        return min_power
```
['Python3']