Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2429. Minimize XOR
Given num1 and num2, find an integer x with the same number of set bits as num2 that minimizes num1 XOR x. This reduces to placing x's 1-bits to match num1's 1-bits as much as possible (favoring higher-significance positions) and filling remaining bits in the least-significant positions to minimize the XOR.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.