|| BIT MANIPULATION, IN ONE PASS O(N)||
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nSo , for even numbers t
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nSo , for even numbers those num has 0th bit not set so cannot find any ans[i] for them always -1 for them , as only prime numbers here so for 2 ans[i] has to be -1\n\n\nFor ODD numbers - if we have something like 23 - 10111 , so here we have possibilities to get this number from(10110 , 10101 , 10011) just make 0 for 1s who is in continuation from start point , now to choose the smallest one we have to make 0 to the farthest one , one with higher value .\nso for 23 - we choose 10011=>19\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\nbasically one traversal with 32 bit num so - 32*n\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n        vector<int>ans;\n        for(int i=0 ; i<nums.size() ; i++){\n            int step=0;\n            int temp=nums[i];\n            if(temp==2){\n                ans.push_back(-1);\n                continue;\n            }\n            while(temp>0){\n                if(temp&1){\n                    step++;\n                    temp>>=1;\n                }\n                else{break;}\n            }\n            int a= 1;\n            a<<=(step-1);\n            nums[i]^=a;\n            ans.push_back(nums[i]);\n\n\n        }\n        return ans;\n    }\n};\n```
['C++']