Easiest soln u will ever find
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:
    vector<int> minBitwiseArray(vector<int>& nums) {
        int n=nums.size();

        vector<int>ans(n,-1);
        
        for(int i=0;i<nums.size();i++){
            

            for(int j=0;j<=nums[i];j++){//run till nums[i] value to find the j ==nums[i]
                
                if((j|(j+1)) == nums[i]){//if found replace -1 with j
                    
                    ans[i] = j;
                    break;
                }
            }
        }
        return ans;
        
    }
};
```
![d9a30a34-57a0-40f1-adab-43bec86a259a_1723795301.0363479.png](https://assets.leetcode.com/users/images/95798d07-fe96-4ceb-9b4a-6bb02c4a9e53_1736926740.8773742.png)

['C++']