Easy to understand
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 
# 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```\nclass Solution {\npublic:\n    int minChanges(int n, int k) {\n        if(n==k) return 0;\n        int ans=0;\n        while(n>0 && k>0){\n            int x = n%2;\n            int y = k%2;\n            if(x==0 && y==1) return -1;\n            if(x==1 && y==0) ans++;\n            n=n/2;\n            k=k/2;\n        }\n        while(n>0){\n            int x= n%2;\n            if(x==1) ans++;\n            n=n/2;\n        }\n        while(k>0){\n            int x = k%2;\n            if( x==1) return -1;\n            k=k/2;\n        }\n        return ans;\n    }\n};\n```
['C++']