[Python3] Bit Manipulation | No hashset | Power of 2 | O(1) Space
The solution must be the first power of 2 not in nums. The intuition is that you can construct all other numbers given powers of 2.\n\np is a binary number that
The solution must be the first power of 2 not in `nums`. The intuition is that you can construct all other numbers given powers of 2.\n\n`p` is a binary number that will act similar to a hashset. Whenever we find a power of 2 using `n & (n - 1) == 0`, we mark it in `p`. Our second iteration, will look for the first power of 2 not marked in `p`, and that will be our `res`.\n\n**O(N) Time\nO(1) Space**\n\n```py\nclass Solution:\n    def minImpossibleOR(self, nums: List[int]) -> int:\n        p = 0\n        for n in nums:\n            if n & (n - 1) == 0:\n                p |= n\n        res = 1\n        while res & p:\n            res <<= 1\n        return res\n```
['Bit Manipulation', 'Python3']