Swift💯
Bit Logic (accepted answer)\nn | k == n ensures that k has no bit set that is not already set in n. If k has a bit set that is not in n, then it is impossible t
**Bit Logic (accepted answer)**\n`n | k == n` ensures that `k` has no bit set that is not already set in `n`. If `k` has a bit set that is not in `n`, then it is impossible to transform `n` into `k` by turning off bits. Once we know it\'s possible, `n ^ k` returns all the bits that are different between `n` and `k`  (these should be 1 in `n` and 0 in `k`). Report a count of those bits.\n```\nclass Solution {\n    func minChanges(_ n: Int, _ k: Int) -> Int {\n        (n|k) == n ? (n^k).nonzeroBitCount : -1\n    }\n}\n```
['Swift']