@@ -0,0 +1,572 @@
+import java.util.*;%0A%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        // convert to binary and split into strings of consecutive ones%0A        String%5B%5D groupings = Integer.toBinaryString(n).split(%220%22);%0A        // sorting strings only composed of a single character (%221%22) orders them by length%0A        Arrays.sort(groupings);%0A        %0A        // print length of lexicographically last string%0A        System.out.println(groupings%5Bgroupings.length - 1%5D.length());%0A    %7D%0A%7D%0A

Create max-consecutive-ones-in-binary-number-4.java