One of the Easiest solution With explanation | C++| Beats 100%
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\n\n/*\n    LOGIC:                                                  \n    1). First to find the first unset bit of nums[i]. eg 0101 ,2nd position is the first unset bit i:e 0\n                                                           ^\n                                                           |\n    2). simply change that bit which are present just before the first unset bit.   eg: 0 1 0 1\n                                                                                 index: 3 2 1 0 ,simply change the zero index bit\n*/\n\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n        vector<int> ans;\n        for(int i=0;i<nums.size();i++)\n        {\n            if(nums[i]==2)\n             ans.push_back(-1);\n\n            \n            else{\n                int j=0;\n                int n=nums[i];\n                while(n!=0)\n                {\n                    if(((n)&(1))==0)\n                    {\n                        break;\n                    }\n                    n= n>>1;\n                    j++;\n                }\n                j--;\n                int k=1;\n                ans.push_back(((nums[i])&(~(k<<j))));\n            }  \n        }\n        return ans;\n    }\n};\n\n// 47 101111\n// 45 101101\n// 39 100111\n\n// 0010 0011 0101 0111\n\n// 0001\n// 0100\n\n// 0011\n\n// 11\n// 1011\n// 0010\n// 1101\n\n// 9\n// 1001\n\n// 13\n// 1101\n\n// 0111\n\n\n// 17\n// 10001\n\n// 19\n// 10011\n\n// 15\n\n\n\n\n```
['C++']