//url:https://leetcode.com/problems/binary-gap/description/
class Solution {
public:
int binaryGap(int N) {
int x=1;
int sum=x;
int findIndex=-1;
int index=1;
if(N&x){
findIndex=index;
}
int maxDistance=0;
while(sum(index-findIndex)?maxDistance:(index-findIndex);
findIndex=index;
}
}
}
return maxDistance;
}
};