Hackerrank – Maximizing XOR

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
Create all pairs for all numbers in interval [l, r]. XOR each pair and select maximum.

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby