pro c++ code || time complexity O(N) || space complexity O(1)||simple bitmask observation
Intuition\njust observe and try to visualise every testcases given at start point\nby changing them into bits\n\n# Approach\n Describe your approach to solving 
# Intuition\njust observe and try to visualise every testcases given at start point\nby changing them into bits\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n- O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\n\nprivate:\n    int findOperation(int n) {\n        int k = n;\n        int m = 1;\n        int i = 0;\n        while (k & 1) {\n            if (i >= 1) {\n                m = m << 1;\n            }\n            k = k >> 1;\n            i++;\n        }\n        return n ^ m;\n    }\n\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n        vector<int> ans;\n        int n = nums.size();\n        for (int i = 0; i < n; i++) {\n            if (nums[i] == 2)\n                ans.push_back(-1);\n            else {\n                int m = findOperation(nums[i]);\n                ans.push_back(m);\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']