Simple approach c++


#1

int Solution::solve(int A) {
int count=0,ans=0;
if(A==0) return 1;
while(A!=0){
ans=A%2;
if(ans==1) break;
if(ans==0) count++;
A=A/2;
}
return count;
}