Created
April 2, 2018 21:37
-
-
Save KamilLelonek/c276d6fadc3195cce86b5ab7a85c88bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp leading_zeros(input) do | |
input | |
|> :binary.bin_to_list() | |
|> Enum.find_index(&(&1 != 0)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment