O(32) Constant Solution | Explained Step by Step | Easy to understand
Intuition\n Describe your first thoughts on how to solve this problem. \nBit Manuplation Question\n# Approach\n Describe your approach to solving the problem. \
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nBit Manuplation Question\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe can observe if the smaller numbers are present we can produce the larger one. \nEg: if 1 is persent and 2 is present we can produce 3.\nIf 1,2 and 4 are present we can produce all nos till 7.\nIf 1,2,4,and 8 are present we can produce all nos till 15.\nSo on.......\nSo blindly find the first missing power of 2.\nThats the answer.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(32)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\n\nclass Solution:\n    def minImpossibleOR(self, nums: List[int]) -> int:\n        \n        nums=set(nums)\n        for i in range(0,32):\n            if 2**i not in nums:\n                return 2**i\n        \n\n```
['Math', 'Bit Manipulation', 'Python3']