BEATS 100% || C++ || EASY 
Complexity
Time complexity: O(N^2)

Space complexity: O(1)
Code


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

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

# Code
```cpp []
class Solution {
public:
    vector<int> minBitwiseArray(vector<int>& nums) {
        int n=nums.size();
        vector<int> ans(n,-1);
        for(int i=0;i<n;i++){
            for(int j=0;j<nums[i];j++){
                if((j| (j+1))==nums[i]){
                    ans[i]=j;
                    break;
                }
            }
        }
        return ans;
    }
};
```
['C++']