Simple solution
Intuition\n\n\n# Approach\n\n\n# Complexity\n- Time complexity:\nO(n*n)\n\n- Space complexity:\nO(n)\n\n# Code\ncpp []\nclass Solution {\npublic:\n    vector<in
# Intuition\n\n\n# Approach\n\n\n# Complexity\n- Time complexity:\nO(n*n)\n\n- Space complexity:\nO(n)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> minBitwiseArray(vector<int>& nums) {\n        vector<int> ans;\n\n        for (int j = 0; j < nums.size(); j++)\n        {\n            for (int i = 0; i < nums[j]; i++)\n            {\n                if ((i | (i + 1)) == nums[j])\n                {\n                    ans.push_back(i);\n                    break;\n                }\n            }\n            if (ans.size() < (j+1))\n            {\n                ans.push_back(-1);\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']