Easy Solution using Bit Manipulation
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\n#define isBit1(x,i) ((x >> i) & 1)\nclass Solution {\npublic:\ninline int setBit1(int x, int i) {\n        return (x | (1 << i));\n    }\n    inline int setBit0(int x, int i) {\n        return (x & ~(1 << i));\n    }\n\n    int fun(int n)\n    {\n        if(n==2)   return -1;\n        int i=0,a=n,b=n;\n\n        for(i=0;i<32;i++)\n        {\n            if(!isBit1(n,i))    break;\n        }\n        bool x=true;\n        for(int j=i-1;j>=0;j--)\n        {\n            if(x)\n            {\n                a=setBit0(a,j);\n                x=false;\n            }\n            else\n            {\n                b=setBit0(b,j);\n            }\n        }\n        return min(a,b);\n    }\n\n    vector<int> minBitwiseArray(vector<int>& n) {\n        vector<int> v;\n        for(int i=0;i<n.size();i++)\n        {\n            v.push_back(fun(n[i]));\n        }\n        return v;\n    }\n};\n```
['C++']