Bit Manipulation
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n$$O(n Log(max(nums[i])))$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n        int n = nums.size();\n        vector<int> res(n , -1);\n        for(int i = 0 ; i < n ; i++){\n            if(nums[i] == 2) continue;\n            int num = nums[i];\n            int a = 1;\n            while((num & a) != 0){\n                a = a << 1;\n            }\n            a = a >> 1;\n            num = num - a;\n            res[i] = num;\n        }\n        return res;\n    }\n};\n```
['C++']