C++ Super-Easy and Clean Solution, 0 ms Beats 100%
Code\ncpp []\nclass Solution {\npublic:\n    int minChanges(int n, int k) {\n        int res = 0;\n        while (n) {\n            if (n % 2 != k % 2) {\n     
# Code\n```cpp []\nclass Solution {\npublic:\n    int minChanges(int n, int k) {\n        int res = 0;\n        while (n) {\n            if (n % 2 != k % 2) {\n                if (n % 2) res++;\n                else return -1;\n            }\n            n /= 2;\n            k /= 2;\n        }\n        return k ? -1 : res;    \n    }\n};\n```
['C++']