Detailed Explanation 100% beats
Summary\n- \n\n# Approach\n1. Check for immediate equality: If n is already equal to k, return 0.\n2. Bitwise comparison: \n    - Iterate through each bit of n 
# Summary\n- \n\n# Approach\n1. Check for immediate equality: If n is already equal to k, return 0.\n2. Bitwise comparison: \n    - Iterate through each bit of n and k.\n    - For each bit, check if k has a 1 bit where n has a 0 bit. If so, return -1.\n    - Count the number of 1 bits in n that need to be turned to 0 (i.e., positions where n has a 1 bit and k has a 0 bit).\n3. Return the count.\n\n# Complexity\n- Time complexity: O(logmax(n,k)), since we are iterating through the bits of the integers n and k. The number of bits is proportional to the logarithm of the value.\n\n- Space complexity:  O(1), as we are using a fixed amount of extra space regardless of the input size.\n\n# Code\n\n```Java []\nclass Solution {\n    public int minChanges(int n, int k) {\n        if (n == k) {\n            return 0;\n        }\n\n        int count = 0;\n        while (n > 0 || k > 0) {\n            int bitN = n & 1;\n            int bitK = k & 1;\n\n            if (bitK == 1 && bitN == 0) {\n                return -1;\n            }\n\n            if (bitN == 1 && bitK == 0) {\n                count++;\n            }\n\n            n >>= 1;\n            k >>= 1;\n        }\n\n        return count;\n    }\n}\n```\n```C++ []\nclass Solution {\npublic:\n    int minChanges(int n, int k) {\n        if (n == k) {\n            return 0;\n        }\n\n        int count = 0;\n        while (n > 0 || k > 0) {\n            int bitN = n & 1;\n            int bitK = k & 1;\n\n            if (bitK == 1 && bitN == 0) {\n                return -1;\n            }\n\n            if (bitN == 1 && bitK == 0) {\n                count++;\n            }\n\n            n >>= 1;\n            k >>= 1;\n        }\n\n        return count;\n    }\n};\n```\n```Python []\nclass Solution:\n    def minChanges(self, n: int, k: int) -> int:\n        if n == k:\n            return 0\n        \n        count = 0\n        while n > 0 or k > 0:\n            bitN = n & 1\n            bitK = k & 1\n            \n            if bitK == 1 and bitN == 0:\n                return -1\n            \n            if bitN == 1 and bitK == 0:\n                count += 1\n                \n            n >>= 1\n            k >>= 1\n        \n        return count\n```\n```Javascript []\n/**\n * @param {number} n\n * @param {number} k\n * @return {number}\n */\nvar minChanges = function(n, k) {\n    if (n === k) {\n        return 0;\n    }\n\n    let count = 0;\n    while (n > 0 || k > 0) {\n        let bitN = n & 1;\n        let bitK = k & 1;\n\n        if (bitK === 1 && bitN === 0) {\n            return -1;\n        }\n\n        if (bitN === 1 && bitK === 0) {\n            count++;\n        }\n\n        n >>= 1;\n        k >>= 1;\n    }\n\n    return count;\n};\n```\n```Dart []\nclass Solution {\n  int minChanges(int n, int k) {\n    if (n == k) {\n      return 0;\n    }\n\n    int count = 0;\n    while (n > 0 || k > 0) {\n      int bitN = n & 1;\n      int bitK = k & 1;\n\n      if (bitK == 1 && bitN == 0) {\n        return -1;\n      }\n\n      if (bitN == 1 && bitK == 0) {\n        count++;\n      }\n\n      n >>= 1;\n      k >>= 1;\n    }\n\n    return count;\n  }\n}\n```\n```Golang []\nfunc minChanges(n int, k int) int {\n    if n == k {\n        return 0\n    }\n\n    count := 0\n    for n > 0 || k > 0 {\n        bitN := n & 1\n        bitK := k & 1\n\n        if bitK == 1 && bitN == 0 {\n            return -1\n        }\n\n        if bitN == 1 && bitK == 0 {\n            count++\n        }\n\n        n >>= 1\n        k >>= 1\n    }\n\n    return count\n}\n```
['Python', 'C++', 'Java', 'Go', 'Python3', 'JavaScript', 'Dart']