Skip to content

Instantly share code, notes, and snippets.

@royratcliffe
Last active September 25, 2022 19:55
Show Gist options
  • Save royratcliffe/9ad93d7b116ae5706ddaf05cc0b1bc32 to your computer and use it in GitHub Desktop.
Save royratcliffe/9ad93d7b116ae5706ddaf05cc0b1bc32 to your computer and use it in GitHub Desktop.
Elixir
‎‎​
# Reads all lines from standard input. Trims the trailing new-line characters.
# Converts each line's characters to an integer.
IO.stream(:stdio, :line)
|> Enum.map(&String.trim/1)
|> Enum.map(&String.to_integer/1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment