The best solve in python
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def minChanges(self, n: int, k: int) -> int:\n        n=bin(n)[2:].zfill(20)\n        k=bin(k)[2:].zfill(20)\n        c=0\n        for i in range(len(n)):\n            if n[i]=="0" and k[i]=="1":\n                return -1\n            elif n[i]=="1" and k[i]=="0":\n                c+=1\n        return c\n```
['Python3']