Maximizing XOR

The maximizing XOR challenge from HackerRank.com