Easy to understand 
IntuitionWe need to find the smallest integer x such that x | (x + 1) equals the prime number at each index of the array. If no such x exists, we return -1Appro
# Intuition

We need to find the smallest integer `x` such that `x | (x + 1)` equals the prime number at each index of the array. If no such `x` exists, we return `-1`

---

# **Approach**

1. Initialize an answer array `ans` with `-1` (because the default answer is `-1` if no valid `x` is found).

2. Loop through each prime number in `nums` and check values of `x` from `0` to that prime.

3. If `x | (x + 1)` equals the prime, store `x` in `ans[i]` and stop checking further.

4. Return the final array `ans`


# Code
```cpp []
class Solution {
public:
    vector<int> minBitwiseArray(vector<int>& nums) {
     vector<int> ans(nums.size(), -1); //set all values to -1 by default 
     
     for (int i = 0; i < nums.size(); i++) {
        for (int x = 0; x <= nums[i]; x++) { // test values from 0 to nums[i]
            if ((x | (x + 1)) == nums[i]) { //if condition is not satisfied ans[i] remains -1
                ans[i] = x;
                break;
            }
        }  
     }   
     return ans;
    }
};
```
['C++']