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

Copy set bits in a range #1540

Closed 072arushi closed 2 years ago

072arushi commented 2 years ago

Description

Given two numbers x and y, and a range [l, r] where 1 <= l, r <= 32. The task is to consider set bits of y in the range [l, r] and set these bits in x also.

Examples :

Input : x = 10, y = 13, l = 2, r = 3 Output : x = 14

Input : x = 8, y = 7, l = 1, r = 2 Output : x = 11

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.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 3 days with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity. Please reopen this issue if not resolved.