C++ || Hashing || Solution with explanation
\n\n Describe your approach to solving the problem. \nIf 1 and 2 are present in the array then all the number from 1 to 3 are expressible.\n\nIf 1, 2 and 4 are 
\n\n<!-- Describe your approach to solving the problem. -->\nIf 1 and 2 are present in the array then all the number from 1 to 3 are expressible.\n\nIf 1, 2 and 4 are present in the array then all the number from 1 to 7 are expressible.\n\nIf 1, 2, 4 and 8 are present in the array then all the numbers from 1 to 15 are expressible.\n\nIf 1, 2, 4, 8 and 16 are present in the array then all the numbers from 1 to 31 are expressible.\n\nTherefore we need to find the smallest integer which can be expressed as power of 2 and which is not present in the array.\n\n# Complexity\n- Time complexity:\n  O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n  O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minImpossibleOR(vector<int>& nums) {\n        unordered_set<int> s(nums.begin(),nums.end());\n        int temp=1;\n        for(int i=1;i<32;i++){\n            if(s.find(temp)==s.end()) return temp;\n            temp=temp*2;\n        }\n        return temp; \n    }\n};\n```
['C++']