@@ -0,0 +1,1164 @@
+package algorithms.bit_manipulation;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Given two integers, L and R, find the maximal value of A xor B, where A and B%0D%0A * satisfy the following condition:%0D%0A * %0D%0A * L %3C= A %3C= B %3C= R%0D%0A * %0D%0A * Input Format: %0D%0A * The input contains two lines; L is present in the first line and R in the%0D%0A * second line.%0D%0A * %0D%0A * Constraints:%0D%0A * 1 %3C= L %3C= R %3C= 10%5E3%0D%0A * %0D%0A * Output Format: %0D%0A * The maximal value as mentioned in the problem statement.%0D%0A * %0D%0A * Sample Input: %0D%0A * 10%0D%0A * 15%0D%0A * %0D%0A * Sample Output: %0D%0A * 7%0D%0A */%0D%0Apublic class MaximizingXOR %7B%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        %0D%0A        Scanner sc = new Scanner(System.in);%0D%0A        %0D%0A        int low = Integer.parseInt(sc.nextLine());%0D%0A        int high = Integer.parseInt(sc.nextLine());%0D%0A        int max = -1;%0D%0A        %0D%0A        for (int i = low; i %3C= high; i++) %7B%0D%0A            int currMax = -1;%0D%0A            for (int j = i; j %3C= high; j++) %7B%0D%0A                currMax = i %5E j;%0D%0A                if (currMax %3E max) %7B%0D%0A                    max = currMax;%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D%0D%0A        System.out.println(max);%0D%0A        sc.close();%0D%0A    %7D%0D%0A%7D

Add MaximizingXOR