Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum XOR #694

Open
Ritika122001 opened this issue Oct 6, 2022 · 0 comments
Open

Minimum XOR #694

Ritika122001 opened this issue Oct 6, 2022 · 0 comments

Comments

@Ritika122001
Copy link

I would like to add a solution to this problem in C++.
Given two positive integers num1 and num2, find the integer x such that:
x has the same number of set bits as num2, and
The value x XOR num1 is minimal.
Note that XOR is the bitwise XOR operation.
Return the integer x.

I/P : - num1 = 3, num2 = 5
O/P:- 3

Kindly Assign it to me!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant