ONE line Solution C++


#1

int Solution::solve(int A) { return __builtin_ctz(A); }


#2

how about this one liner…

int Solution::solve(int A) {
    return log2(A^(A&(A-1)));
}


#3

and this :wink:
return log2(A&(-A));


#4

return log2(A&(~(A-1))) ;
:smile: