Created
March 23, 2017 20:37
-
-
Save divmgl/6d4a108b9264d36f24bcfac81131a32c to your computer and use it in GitHub Desktop.
Revisions
-
divmgl created this gist
Mar 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ long bits = 0; long max = 0; void binary(long N) { if (N > 1) { binary(N / 2); } if (N % 2 == 0) { bits += 1; return; } if (max < bits) { max = bits; } bits = 0; } long solution(long N) { binary(N); return max; }