int solution(int N) {
// write your code in C99 (gcc 4.8.2)
int a[100] = { 0 };
int i = 0;
int len = 0;;
int maxlen = 0;
while (N){
a[i] = N % 2;
N = N / 2;
if (a[i] == 1){
if (maxlen < len){ maxlen = len; len = 0; }
else{ len = 0; }
}
else{
len++;
}
i++;
}
return maxlen;
}