Simple solution, O(n)
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```java []\nclass Solution {\n    public int minChanges(int n, int k) {\n        String nStr = Integer.toBinaryString(n);\n        String kStr = Integer.toBinaryString(k);\n\n        int nStrLen = nStr.length();\n        int kStrLen = kStr.length();\n\n        int operationCount = 0;\n\n        if (n == k) return 0;\n\n        if (nStrLen > kStrLen) {\n            for (int i=1; i<=(nStrLen - kStrLen); i++) {\n                kStr = "0" + kStr;\n            }\n        }\n        else if (nStrLen < kStrLen) {\n            for (int i=1; i<=(kStrLen - nStrLen); i++) {\n                nStr = "0" + nStr;\n            }\n        }\n\n        for (int i=0; i<nStrLen; i++) {\n            if (nStr.charAt(i) != kStr.charAt(i)) {\n                if (nStr.charAt(i) != \'1\') {\n                    return -1;\n                }\n                else operationCount++;\n            }\n        }\n\n        return operationCount;\n    }\n}\n```
['Java']