You are viewing a single comment's thread. Return to all comments →
What is the difference...
char [] twoBase = Integer.toBinaryString(n).toCharArray(); int counter = 0; int max=0; for(char nums: twoBase){ if(nums =='1'){ counter++; } else{ counter=0; } if(max<counter) max = counter; } System.out.println(max);
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 →
What is the difference...