You are viewing a single comment's thread. Return to all comments →
My Elixir solution:
defmodule Solution do def main() do IO.read(:stdio, :all) |> String.split() |> Enum.map(&String.to_integer(&1)) |> get_absolutes end def get_absolutes(list) do Enum.each(list, fn(x) -> if x < 0, do: IO.puts(x * -1), else: IO.puts(x) end ) end end Solution.main()
Update List
You are viewing a single comment's thread. Return to all comments →
My Elixir solution: