✅☑️ Best C++ Solution Ever || Bit Manipulation || Hash Table || One Stop Solution.
Intuition\n Describe your first thoughts on how to solve this problem. \nWe can solve this question using Array + Bit Manipulation + Hash Table.\n\n# Approach\n
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe can solve this question using Array + Bit Manipulation + Hash Table.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe can easily understand the approach by seeing the code which is easy to understand with comments.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nTime Complexity : O(N), where N is the size of the array(nums). Here loop creates the time complexity O(N).\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nSpace Complexity: O(N), Hash Table(unordered_set(set)) space.\n\n\n# Code\n```\n/*\n\n    Time Complexity : O(N), where N is the size of the array(nums). Here loop creates the time complexity O(N).\n\n    Space Complexity: O(N), Hash Table(unordered_set(set)) space.\n\n    Solved using Array + Bit Manipulation + Hash Table.\n\n*/\n\nclass Solution {\npublic:\n    int minImpossibleOR(vector<int>& nums) {\n        unordered_set set(nums.begin(), nums.end());\n        int Or = 1;\n        for(auto num : nums){\n            if(set.find(Or) != set.end()){\n                Or <<= 1;\n            }\n        }\n        return Or;\n    }\n};\n\n```\n\n***IF YOU LIKE THE SOLUTION THEN PLEASE UPVOTE MY SOLUTION BECAUSE IT GIVES ME MOTIVATION TO REGULARLY POST THE SOLUTION.***\n\n![WhatsApp Image 2023-02-10 at 19.01.02.jpeg](https://assets.leetcode.com/users/images/0a95fea4-64f4-4502-82aa-41db6d77c05c_1676054939.8270252.jpeg)
['Array', 'Hash Table', 'Bit Manipulation', 'C++']