Easy to understand solution in c++ 
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int solve(int value,string &st){
        string str = "";
        int temp = value;
        while(temp>0){
            
            str += to_string(temp&1);
            temp >>=1;
        }
        str += '0';
        reverse(str.begin(),str.end());
        int i = str.length()-1;
        bool flag = false;
        while(i>0){
            if(str[i-1] == '0' && flag == false){
                str[i] = '0';
                flag = true;
            }
            i--;
        }
        long long s = 1;
        long long  j = str.length()-1;
        long long val = 0;
        while(j>=0){
            val += (str[j]-'0')*s;
            j--;
            s = s*2;
        }
        st = str;
        return val;


    }
    vector<int> minBitwiseArray(vector<int>& nums) {
        int n = nums.size();
        vector<int> ans(n);
        for(int i = 0; i<nums.size(); i++){
            int val = nums[i];
            if(val == 2){
                ans[i] = -1;
            }
            else{
                string st = "";
                ans[i] = solve(val,st);
                cout<<st<<endl;
            }
        }
        return ans;
    }
};
```
['Array', 'Bit Manipulation', 'C++']