C# easy , 0 ms Beats 100.00%
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public int MinChanges(int n, int k) {
        if (n == k)
            return 0;
        // 2 lik sanoq tizimiga otkazish
        string b = Convert.ToString(n, 2); 
        string c = Convert.ToString(k, 2); 
        
        // Uzunligi kichik bo'lgan stringni nol bilan to'ldiramiz
        while (b.Length > c.Length)
            c = "0" + c;
        while (c.Length > b.Length)
            b = "0" + b;
        
        int j = 0, r = 0;
        for (int i = 0; i < b.Length; i++) {
            if (b[i] == '1' && c[i] == '0') {
                j += 1;
            }
            if (b[i] == '0' && c[i] == '1') {
                r += 1;
            }
        }
        return (r == 0) ? j : -1;
    }
}

```
['C#']