VERY EASY SOLUTION||C++||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 []\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n      //when we do nums|nums + 1 example 10100111 + 10101111 = 10101111\n      // we observe that it sets till leftmost 0 bit \n      // if nums[i] leftmost bit is 0 then there will be no ans[i]\n      // because if ans[i] has leftmost bit 0 then it will be set after\n      // ans[i] | ans[i+1] if leftmost bit is 1 then also ans[i]|ans[i+1]\n      // will give 1 as leftmost bit\n      // if nums[i] has trailing ones then ans could be formed by converting \n      // any of them to 0 , so we need to set leftmost trailing 1 to 0 to get\n      // least value of ans\n       vector<int>ans;\n       for(int num : nums)\n       {\n        if(num%2 == 0)\n        {\n            ans.push_back(-1);\n            continue;\n        }\n        int i;\n        cout<<num<<endl;\n            for( i = 0; i < 31; i++)\n            {\n                // to get ith bit num &( 1 << i)\n                if(!(num & (1 << i))) break;\n            }\n           // cout<<"I "<<i<<endl;\n                // to invert i-1 th bit we use xor ^ operation\n            ans.push_back(num ^ (1 << (i-1)));\n      \n       }\n       return ans;\n    }\n};\n```
['C++']