Beats 100%
Complexity\n- Time complexity:O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Cod
# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& arr) {\n        int n = arr.size() ;\n        vector<int> ans ;\n\n        for(int i = 0;i<n;i++){\n            if(arr[i] == 2){\n                ans.push_back(-1);\n            }\n            else{\n                for(int j = 1;j<31;j++){\n                    if((arr[i] & (1<<j)) == 0){\n                        ans.push_back(arr[i] ^ (1 << (j-1)));\n                        break;\n                    }\n                }\n            }\n        }\n\n        return ans;\n    }\n};\n```
['Array', 'Bit Manipulation', 'C++']