Easy Solution | Whithout shift operator | Simple logic
Approach\nLoop through the input list of numbers:\nFor each number in the list nums, we find the smallest possible i for that number.\n\nWe iterate through each
# Approach\nLoop through the input list of numbers:\nFor each number in the list nums, we find the smallest possible i for that number.\n\nWe iterate through each bit of num from the most significant bit (MSB) to the least significant bit (LSB).\nFor each bit, we flip that bit (change 1 to 0 or 0 to 1) and check if the modified number satisfies the condition ```i \u2223 (i+1) == num.```\nIf we find such a number i, we return it.\nIf no such number is found after trying all bits, return -1.\n\n# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```java []\nclass Solution {\n    public int[] minBitwiseArray(List<Integer> nums) {\n        int ans[] = new int[nums.size()];\n        for(int i = 0; i < nums.size(); i++)\n        {\n            int flag = 0;\n            int v = nums.get(i);\n            String b = Integer.toBinaryString(v);\n            \n            for(int j = 0; j < b.length(); j++)\n            {\n                if(b.charAt(j) == \'1\')\n                {\n                    String b1 = b.substring(0,j) + \'0\' + b.substring(j+1);\n                    int v1 = Integer.parseInt(b1, 2);\n                    if((v1 | (v1 + 1)) == v)\n                    {\n                        ans[i] = v1;\n                        flag = 1;\n                        break;\n                    }\n                }\n            }\n            if(flag == 0)\n                ans[i] = -1;\n        }\n        return ans;\n    }\n}\n```
['Array', 'String', 'Bit Manipulation', 'Bitmask', 'Java']