Lakhankumawat / LearnCPP

Learn Cpp from Beginner to Advanced ✅ Practice 🎯 Code 💻 Repeat 🔁 One step solution for c++ beginners and cp enthusiasts.
https://lakhankumawat.github.io/LearnCPP/
MIT License
642 stars 490 forks source link

Maximize the Expression #1533

Closed 072arushi closed 2 years ago

072arushi commented 2 years ago

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

github-actions[bot] commented 2 years ago

Hello @072arushi, thanks for creating your first issue at LearnCPP, hope you followed the guidelines.

072arushi commented 2 years ago

/assign

github-actions[bot] commented 2 years ago

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.