Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
sub{sprintf("%064b",@_)=~/^0*/;length$&;$+[0]}
Try it online!Try it online!
Or this 4346 bytes if the "stringification" is not allowed: sub z
sub{my$i=0;$_[0]>>64-$_?last:$i++for 1..64;$i}
{sprintf("%064b",@_)=~/^0*/;length$&}
Try it online!
Or this 43 bytes if the "stringification" is not allowed: sub z
{my$i=0;$_[0]>>64-$_?last:$i++for 1..64;$i}
sub{sprintf("%064b",@_)=~/^0*/;$+[0]}
Or this 46 bytes if the "stringification" is not allowed: sub z