You are viewing a single comment's thread. Return to all comments →
Here is my solution,
String[] binary = Integer.toBinaryString(n).split("0"); int count = 0; for(int i = 0; i < binary.length; i++){ count = binary[i].length() > count ? binary[i].length() : count; } System.out.println(count);
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
Here is my solution,