MAXXOR  Find the max XOR value
You have two integers L and R, and you are required to find the max xor value of a and b where L <= a <= R and L <= b <= R
Input
Two integers in a line. L, R <= 1e9
Output
One integer, the answer
Example
Input: 1 10 Output: 15
hide comments
nimphy:
20180501 09:15:42
so what should do to solve it not using the formula??? 

anubhav1772:
20170710 12:12:49
AC in One Go :)


sagar_zhcet:
20170607 21:50:00
@karthik1997: try your formula for L=8 and R=10. your formula is wrong. 

praney_rai:
20170126 16:42:27
weak test cases my code got ac. but for input 1 1 it shows 1 but ans should be 0. :D


narutorocks:
20160610 18:44:17
Nice Question .Ignore the formula.Try on your own.


mkfeuhrer:
20160607 22:09:06
don't use this formula.....its wrong for many cases...but it works here....use logic to get the beauty of ques. AC :) 

vikke:
20160416 21:34:21
awesome problem


topke:
20160128 16:56:22
Yea very weak test cases that's why formula is passing. Try 100 120 i bet half of these solutions won't pass. Plus it would be nice from author to remove formula from comments. 

anil2496:
20160104 21:00:34
weak test cases


Sayak Haldar:
20160104 17:27:32
@karthik1997: your formula is actually wrong. Since, the testcases are weak your solution got AC (if you strictly follow the formula) 
Added by:  SCaffrey 
Date:  20151203 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 
Resource:  https://www.hackerrank.com/challenges/maximizingxor 