Maximizing XOR Discussions | Algorithms | HackerRank
  • + 1 comment

    Nice solution. It can be written in one line:

    System.out.println(Integer.highestOneBit(L ^ R) * 2 - 1);