Search
⌘K

Leetcode 3226. Number of Bit Changes to Make Two Integers Equal

Check whether every 1-bit in k is also 1 in n — if not it's impossible. If it is, the answer is the number of 1-bits in n that must be turned to 0 to match k (the 1s present in n but not in k).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.