Java&JS&TS Solution (JW)
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
public int[] minBitwiseArray(List<Integer> nums) {
    int n = nums.size();
    int[] ans = new int[n];
    
    for (int i = 0; i < n; i++) {
        int num = nums.get(i);
        boolean found = false;
        for (int x = 0; x <= num; x++) {
            if ((x | (x + 1)) == num) {
                ans[i] = x;
                found = true;
                break;
            }
        }
        if (!found) {
            ans[i] = -1;
        }
    }
    
    return ans;
}
```
```javascript []
var minBitwiseArray = function(nums) {
    const ans = [];

    for (let i = 0; i < nums.length; i++) {
        let num = nums[i];
        let found = false;

        for (let x = 0; x <= num; x++) {
            if ((x | (x + 1)) === num) {
                ans.push(x);
                found = true;
                break;
            }
        }

        if (!found) {
            ans.push(-1);
        }
    }

    return ans;
};
```
```typescript []
function minBitwiseArray(nums: number[]): number[] {
    const ans: number[] = [];

    for (let i = 0; i < nums.length; i++) {
        const num = nums[i];
        let found = false;

        for (let x = 0; x <= num; x++) {
            if ((x | (x + 1)) === num) {
                ans.push(x);
                found = true;
                break;
            }
        }

        if (!found) {
            ans.push(-1);
        }
    }

    return ans;
};
```
['Array', 'Bit Manipulation', 'Java', 'TypeScript', 'JavaScript']