BIT MANIPULATION
Intuition2 Special Cases to Cater , while obseriving Binary Number behaviuorLSB:
nums.get(i)%2 == 1 (01) ending in binary so to make LSB(trainling zeroes) just
# Intuition
2 Special Cases to Cater , while obseriving Binary Number behaviuor

LSB: 
nums.get(i)%2 == 1 (01) ending in binary so to make LSB(trainling zeroes) just subtract 1(power of 2 at LSB ie 1) ans[i] = nums.get(i)-1

nums.get(i)%2 == 3 (11) ending in binary so to make LSB
trailing zeroes just get to the rightMost 0 position (left Shift 1 upto that and subtract that to get you the minimum posible number satifying ans[i] OR ans[i]+1 = nums[i])

for endings 10, 00 are already trailing no need to be taken care of hence other that these cases , ans[i]=-1
BINARY BEHAVIOUR IS TO BE FOCUSED on



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

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

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

# Code
```java []
class Solution {
    public int[] minBitwiseArray(List<Integer> nums) {
        int n = nums.size();
        int[] ans = new int[n];
        for (int i = 0; i <n ; i++){
            if (nums.get(i)%4 == 1){
                ans[i] = nums.get(i)-1;
            } else if (nums.get(i)%4 == 3){
                int temp = nums.get(i);
                int pos = 0;
                while (temp >0){
                    temp >>= 1;
                    if (temp%2 == 0) break;
                    pos ++;
                }
                ans[i] = nums.get(i) - (1<<pos);
            }else {
                ans[i]= -1;
            }
        }
        return ans;
    }
}
```
['Java']