Skip to content

Latest commit

 

History

History
 
 

MaximizingXor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Maximizing XOR

Given two integers: L and R,

find the maximal values of A xor B given, L ≤ A ≤ B ≤ R

###Input Format### The input contains two lines, L is present in the first line. R in the second line.

###Constraints###

1 ≤ L ≤ R ≤ 103

###Output Format### The maximal value as mentioned in the problem statement.

###Sample Input###

1
10

###Sample Output###

15

###Explanation###

The maximum value can be obtained for A = 5 and B = 10,

1010 xor 0101 = 1111 hence 15.