
[LeetCode] 2429. Minimize XOR (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명Given two positive integers num1 and num2, find the positive integer x such that:x has the same number of set bits as num2, andThe value x XOR num1 is minimal.Note that XOR is the bitwise XOR operation. Return the integer x. The test cases are generated such that x is uniquely determined. The number of set bits of an integer is the number of 1's in its binary representation. 문제 ..