C++ Easy Solution :->
Intuition\n Describe your first thoughts on how to solve this problem. \nGet the largest 2\'s power within nums[i]\n\n# Approach\n Describe your approach to sol
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nGet the largest 2\'s power within nums[i]\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nTake largest 2\'s power as k and keep incrementing it till the OR condition satisfies.\n\n# Complexity\n- Time complexity: O(n*m), where m = nums[i]\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ --> O(1)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n\n        vector<int> ans(nums.size());\n        for (int i = 0; i < nums.size(); i++) {\n            if (nums[i] % 2 == 0) {\n                ans[i] = -1;\n                continue;\n            }\n            int k = 1;\n            while (k * 2 <= nums[i]) {\n                k *= 2;\n            }\n            while (k < nums[i]) {\n\n                int chk = k | k - 1;\n                if (chk == nums[i]) {\n                    ans[i] = k - 1;\n                    break;\n                }\n\n                chk = k | k + 1;\n                if (chk == nums[i]) {\n                    ans[i] = k;\n                    break;\n                }\n                k++;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']