A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps.
Write a function:
function solution($N);
that, given a positive integer N, returns the length of its longest binary gap. The function should return 0 if N doesn't contain a binary gap.
For example, given N = 1041 the function should return 5, because N has binary representation 10000010001 and so its longest binary gap is of length 5. Given N = 32 the function should return 0, because N has binary representation '100000' and thus no binary gaps.
Write an efficient algorithm for the following assumptions:
- N is an integer within the range [1..2,147,483,647].
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = '';
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
print_R($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = '';
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print_R($bin_num);
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = '';
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print_R($bin_num);
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = ';
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print_R($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print_R($bin_num);
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$b = $N / 2;
$bin_num[] = $b % 2;
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print "this is a debug message\n";
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print "this is a debug message\n";
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print $bin_num;
print "this is a debug message\n";
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print implod$bin_num;
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 ) {
$bin_num[] = $N % 2;
$N = $N / 2;
if ($N == 1) break;
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 && $N != 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 0 && $N 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print implode($bin_num);
print "this is a debug message\n";
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = 0 ; $i)
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0)
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $
}
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_nu))
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
$idx++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx)
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx == 0)
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx == 0 && )
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1])
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] != 0)
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) $max = $cnt[$idx];
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max )
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max >)
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max > 0)
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $result;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$result = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
$max = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max > 0)
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max > 0)
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max = 0)
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx];
else
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx];
else {
$max = $max >
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max >
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num)."\n";
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num)."\n"\\;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
// $int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
p
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print implode($bin_num);
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeo($bin_num);
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num);
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num);
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num).'\n';
if (sizeof($bin_num) >0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
print $bin_num[$i].'\n';
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num).'\n';
if (sizeof($bin_num) > 0) {
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
print $bin_num[$i].'\n';
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num).'\n';
if (sizeof($bin_num) > 0) { print "debug";
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
print $bin_num[$i].'\n';
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."n";
if (sizeof($bin_num) > 0) { print "debug";
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
print $bin_num[$i].'\n';
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug";
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
print $bin_num[$i].'\n';
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug";
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug";
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug". ;
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num)-1;
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
for ($i = sizeof($bin_num)-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = sizeof($bin_num)
for ($i = -1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = sizeof($bin_num);
for ($i = -1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = sizeof($bin_num);
for ($i = $size-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = c($bin_num);
for ($i = $size-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = count($bin_num);
for ($i = $size-1 ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = count($bin_num);
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) { print "debug".sizeof($bin_num);
$size = count($bin_num)-1;
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
print sizeof($bin_num)."\n";
if (sizeof($bin_num) > 0) {
$size = count($bin_num)-1; print $size;
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = count($bin_num)-1; print $size;
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $size;
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
//$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i <= 0 ; $i--) {
print $bin_num[$i]."\n";
//$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i <= 0 ; $i--) {
print "ssss";
//$re_bin_num[] = $bin_num[$i];
}
$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i <= 0 ; $i--) {
print "ssss";
//$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
print $int_bin_num;
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i <= 0 ; $i--) {
print "ssss";
//$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1; print $bin_num[3];
for ($i = $size ; $i >= 0 ; $i--) {
print "ssss";
//$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++;
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++; print $idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$idx++; print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
$ print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($idx > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ( > 0 && $cnt[$idx-1] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($cnt[$idx] > 0) {
if ($max == 0) $max = $cnt[$idx-1];
else {
$max = $max > $cnt[$idx-1] ? $max : $cnt[$idx-1];
}
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($cnt[$idx] > 0) {
$max = $cnt[$idx];
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($cnt[$idx] > 0) {
$max = $cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($$cnt[$idx] > 0) {
$max = $cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($cnt[$idx] != null && $cnt[$idx] > 0) {
$max = $cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($cnt[$idx] != null &&$cnt[$idx] > 0) {
$max = $cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if ($cnt[$idx] > 0) {
$max = $cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $ma$cnt[$idx];
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
/print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
//print implode($re_bin_num);
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
// print "idx: ".$idx."\n";
}
else {
$cnt[$idx]++;
}
}
}
//print implode($bin_num);
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
//$int_bin_num = implode($re_bin_num);
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
$int_bin_num = 0;
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
$re_bin_num[] = $bin_num[$i];
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_)
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i])
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if
}
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if (sizeof($cnt) > )
}
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else
}
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
// $re_bin_num[] = $bin_num[$i];
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
/*
if (sizeof($re_bin_num) > 0) {
$idx = 0;
for ($i = 0 ; $i < sizeof($re_bin_num) ; $i++) {
if ($re_bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else {
$cnt[$idx]++;
}
}
}
*/
return $max;
}
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
return $max;
}
The submission is being evaluated.
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($N) {
$max = 0;
$cnt = array();
$bin_num = array();
$re_bin_num = array();
if ($N > 0) {
while ( $N > 1) {
$bin_num[] = $N % 2;
$N = $N / 2;
}
}
if (sizeof($bin_num) > 0) {
$size = sizeof($bin_num)-1;
$idx = 0;
for ($i = $size ; $i >= 0 ; $i--) {
if ($bin_num[$i]) {
if (sizeof($cnt) > 0 && $cnt[$idx] > 0) {
$max = $max < $cnt[$idx] ? $cnt[$idx] : $max;
$idx++;
}
$cnt[$idx] = 0;
}
else $cnt[$idx]++;
}
}
return $max;
}
The submission is being evaluated.