Created
September 25, 2022 17:04
-
-
Save uxjp/5f6753d684aa1a48b8670726ff1a73dc to your computer and use it in GitHub Desktop.
This file contains 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
defmodule Ab do | |
def abs(x) when x < 0, do: x * -1 | |
def abs(x), do: x | |
end | |
defmodule Solution do | |
IO.read(:all) | |
|> String.split | |
|> Enum.map(&String.to_integer/1) | |
|> Enum.map(&Ab.abs/1) | |
|> Enum.each(&IO.puts/1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment