Flip the First 1 Before the Leftmost 0
IntuitionTo minimize the array element bitwise, flip the leftmost '1' bit before the first '0' in its binary representation. Special cases include numbers ≤2, w
# Intuition  
To minimize the array element bitwise, flip the leftmost '1' bit before the first '0' in its binary representation. Special cases include numbers ≤2, which cannot be minimized further.

# Approach  
1. **Handle Edge Case**: If `nums[i] <= 2`, push `-1` as it's already minimal.  
2. **Iterate and Identify**: For each number, find the leftmost `1` bit before the first `0`.  
3. **Bitwise Operation**: Flip this bit using `nums[i] & (~(1 << j))`.  
4. **Store Result**: Push the result into the output vector.

# Complexity  
- **Time Complexity**: $$O(N)$$, where $$N$$ is the size of the input array.  
- **Space Complexity**: $$O(1)$$ additional space, excluding the result vector.

# Code  
```cpp
class Solution {
public:
    vector<int> minBitwiseArray(vector<int>& nums) {
        vector <int> ans;
        for(int i=0;i<nums.size();i++){
            //leftmost 0 se pehle wala 1 ko flip krna h
            //only 2 is the even prime number
            // so no need to deal with 4(100),8(1000),16(10000),etc.
            //for 3(11 take it as 011) -> push(001)
            if(nums[i]<=2) ans.push_back(-1);
            else{
                int num=nums[i];
                int j=-1;
                while((num&1)| 0 == 1){
                    j++;
                    num=num>>1;
                }
                ans.push_back(nums[i] & (~(1<<j)));
            }
        }
        return ans;
    }
};
```
['Array', 'Bit Manipulation', 'C++']