Skip to content

Instantly share code, notes, and snippets.

@uxjp
Created September 9, 2022 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uxjp/51a341b28b19aea4d1e3e682f8426dc8 to your computer and use it in GitHub Desktop.
Save uxjp/51a341b28b19aea4d1e3e682f8426dc8 to your computer and use it in GitHub Desktop.
Hacker hank scanning 2 integers from STDIN, calling a function, returning a value, and printing it to STDOUT.
defmodule Solution do
a = IO.gets(nil) |> String.trim |> String.to_integer
b = IO.gets(nil) |> String.trim |> String.to_integer
a + b |> IO.puts
end
@uxjp
Copy link
Author

uxjp commented Sep 9, 2022

Think if its possible to do it all in one single sequence of pipes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment