C++ 0 ms
IntuitionApproach2  ->  -1
other -> replace the one before the first zero with zeroComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
2  ->  -1
other -> replace the one before the first zero with zero

# 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) {
        constexpr int len = sizeof(int) * 8;
        for_each(begin(nums), end(nums), [](auto& num) {
            for(int i = 0; i < len; ++i) {
                if(num & (1 << i)) continue;
                i? num ^= 1 << (i - 1): num = -1;
                break;
            }
        });
        return nums;
    }
};
```
['C++']