easy c++ solution
Intuition\neverything written in code\n\n# Code\ncpp []\n#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(v
# Intuition\neverything written in code\n\n# Code\n```cpp []\n#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n        vector<int> ans;\n        int n = nums.size();\n\n        for (int i = 0; i < n; i++) {\n            if (nums[i] % 2 == 0) {\n                ans.push_back(-1);  // Handle even numbers\n            } else {\n                int num = nums[i];\n\n                for (int j = 0; j < 64; j++) {\n                    // Check if the current bit is set\n                    if (num & (1 << j)) {\n                        // If the next bit is 0 or this is the last bit, clear the current bit\n                        if (!(num & (1 << (j + 1)))) {\n                            num &= ~(1 << j);  // Clear the current bit\n                            break;  // Exit after clearing the bit\n                        }\n                    } else {\n                        // If we encounter a 0 after starting the sequence, stop the loop\n                        break;\n                    }\n                }\n\n                ans.push_back(num);  // Store the modified number\n            }\n        }\n        \n        return ans;\n    }\n};\n```
['C++']