Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
defmodule Solution do
def main() do
n = IO.gets("") |> String.strip |> String.to_integer
IO.gets("") |> to_list(n)
end
def read_lines
IO.gets("")
end
def to_list(input, n) do
input
|> String.split
|> Enum.map(fn(x) -> String.to_integer(x) end)
|> Enum.map(fn(i) -> for z <- List.duplicate(i, n), do: IO.puts z end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.