Java Easy Solution
Code\njava []\nclass Solution {\n        public int[] minBitwiseArray(List<Integer> nums) {\n        int len = nums.size();\n        int[] ans = new int[len];\n
# Code\n```java []\nclass Solution {\n        public int[] minBitwiseArray(List<Integer> nums) {\n        int len = nums.size();\n        int[] ans = new int[len];\n\n        for (int i = 0; i < len; i++) {\n            boolean flag = true;\n            for (int j = 1; j < nums.get(i); j++) {\n                if ((j | j + 1) == nums.get(i)) {\n                    ans[i] = j;\n                    flag = false;\n                    break;\n                }\n            }\n\n            if (flag) {\n                ans[i] = -1;\n            }\n        }\n\n        return ans;\n    }\n}\n```
['Java']