MAXXOR - Find the max XOR value
You have two integers L and R, and you are required to find the maximum xor value of a and b where L ≤ a ≤ R and L ≤ b ≤ R.
Input
Two integers in a line. L, R ≤ 109.
Output
One integer, the answer.
Example
Input: 1 10 Output: 15
Added by: | SCaffrey |
Date: | 2015-12-03 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |
Resource: | https://www.hackerrank.com/challenges/maximizing-xor |