Fastest Way || Bit Mask || Never more simpler!
Intuition\n\nFind the minimal 2^n not presented in the array.\n\n\n\n\n\n# Code\n\nclass Solution {\npublic:\n    int minImpossibleOR(vector<int>& nums) {\n    
# Intuition\n\nFind the minimal $$2^n$$ not presented in the array.\n\n![image.png](https://assets.leetcode.com/users/images/8aefde8d-c5b7-4300-9140-ef61b00d1372_1719865914.8669858.png)\n\n\n\n# Code\n```\nclass Solution {\npublic:\n    int minImpossibleOR(vector<int>& nums) {\n        ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);\n        int bitmask =0;\n        for(int x:nums)if((bitmask&x)==0&&(x&(x-1))==0)bitmask+=x;\n        return (bitmask+1)&(-1-bitmask);\n    }\n};\n```
['C++']