3226. Number of Bit Changes to Make Two Integers Equal
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
```python3 []
class Solution:
    def minChanges(self, n: int, k: int) -> int:
        # If n has 0 where k has 1, it's impossible to convert n to k
        if (n & k) != k:
            return -1
        
        # Count how many 1's are in n where k has 0
        return bin(n & ~k).count('1')

```
['Python3']