Closed 072arushi closed 2 years ago
Hello @072arushi, thanks for creating your first issue at LearnCPP, hope you followed the guidelines.
/assign
This issue has been assigned to 072arushi! It will become unassigned if it is not closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.
Description
Given two positive integers A and B. Let’s define D such that B AND D = D. The task is to maximize the expression A XOR D. Examples:
Input: A = 11 B = 4 Output: 15 Take D = 4 as (B AND D) = (4 AND 4) = 4. Also, (A XOR D) = (11 XOR 4) = 15 which is the maximum according to the given condition.
Input: A = 9 and B = 13 Output: 13
Domain
CPP
Type of Contribution
Addition
Code of Conduct