Created
June 20, 2017 14:41
-
-
Save netodevel/39deb33b02d6314e615867f82ac07e79 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 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