[C++] Simple Solution
Code
# Code
```cpp []
class Solution {
public:
    vector<int> minBitwiseArray(vector<int>& A) {
        int N = A.size();
        vector<int> ans(N, -1);

        for(int i=0; i<N; i++) {
            for(int j=0; j<=A[i]; j++) {
                if((j|(j+1)) == A[i]) {
                    ans[i] = j;
                    break;
                }
            }
        }

        return ans;
    }
};
```
['C++']