Simple C++ soluion || Faster than 100% || TC: O(1)
Complexity\n- Time complexity: O(1)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\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        int ans=0;\n        for(int i=0;i<32;i++){\n            if(n &(1<<i)){\n                if(!(k & (1<<i))){\n                    ans++;\n                }\n            }\n            else{\n                if(k & (1<<i)){\n                    return -1;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['Bit Manipulation', 'C++']