@@ -0,0 +1,494 @@
+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        int max = 0;%0A        for(String s : groupings)%7B%0A            if(max %3C s.length())%7B%0A                max = s.length();%0A            %7D%0A        %7D%0A        System.out.println(max);%0A    %7D%0A%7D%0A

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