XOR Method
Intuition\nThought of using bitwise operations to convert n and k to binary.\n\n# Approach\nHad to check if (n|k) == n. If the condition fails, return -1.\n\n# 
# Intuition\nThought of using bitwise operations to convert n and k to binary.\n\n# Approach\nHad to check if (n|k) == n. If the condition fails, return -1.\n\n# Complexity\n- Time complexity:\nUsed XOR ( ^ )\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution(object):\n   \n    def minChanges(self, n, k):\n        if (n|k) !=n: \n            return -1 \n \n        diff = n^k \n        return bin(diff).count(\'1\')\n```
['Python']