Simple String solution -> 1 ms
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:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```java []\nclass Solution {\n    public int minChanges(int n, int k) {\n\n        if (n == k) return 0;\n\n        String nBits = Integer.toBinaryString(n);\n        String kBits = Integer.toBinaryString(k);\n\n        if (nBits.length() < kBits.length()) return -1;\n\n        int ans = 0;\n        for (int i = kBits.length() - 1, j = nBits.length() - 1; i >= 0; i--, j--)\n            if (nBits.charAt(j) == \'1\' && kBits.charAt(i) == \'0\')\n                ans++;\n            else if (nBits.charAt(j) == \'0\' && kBits.charAt(i) == \'1\')\n                return -1;\n\n        for (int i = 0; i < nBits.length() - kBits.length(); i++)\n            if (nBits.charAt(i) == \'1\') ans++;\n\n        return ans;\n    }\n}\n```
['Java']