Copy Set Bits In A Range
easy
1. You are given two numbers A and B. 2. You are given two more numbers left and right, representing a range [left,right]. 3. You have to set bits in B which are set in A lying in the above mentioned range. 4. Print the updated number B.
Constraints
-10^9 <= A,B <= 10^9 1 < left < right < 32
Format
Input
4 numbers representing A,B,left and right.
Output
A number
Example
Sample Input
10
13
2
3
Sample Output
15
Question Video