Easy to understand solution. Beats 100 %
ApproachThe condition if((n & k) != k) ensures that it’s possible to transform n into k. This works because the bitwise AND between n and k should yield k (i.e.
# Approach
The condition if((n & k) != k) ensures that it’s possible to transform n into k. This works because the bitwise AND between n and k should yield k (i.e., n must have all the 1s in k).

If n doesn’t have enough 1s in the positions where k requires them (i.e., n doesn't have all the 1s of k), we return -1 because it's impossible to transform.

If the transformation is possible, we count how many 1s are in n and k using Integer.bitCount(). The number of changes needed is the difference between the number of 1s in n and the number of 1s in k. This is because we can only turn 1s in n into 0s.

# Complexity
- Time complexity:
O(1)

- Space complexity:
O(1)

# Code
```java []
class Solution {
    public int minChanges(int n, int k) {
        if((n & k) != k) {
            return -1;
        }
        return Integer.bitCount(n) - Integer.bitCount(k); 
    }
}
```
['Bit Manipulation', 'Java']