Bitwise
Code
# Code
```php []
class Solution
{

    /**
     * @param Integer $n
     * @param Integer $k
     * @return Integer
     */
    function minChanges($n, $k)
    {
        $count = 0;

        while ($n) {
            $bitN = $n & 1;
            $bitK = $k & 1;

            if ($bitK && !$bitN)
                return -1;

            if (!$bitK && $bitN)
                $count++;

            $k >>= 1;
            $n >>= 1;
        }
        if($k) return -1;
        return $count;
    }
}
```
['PHP']