Skip to content

Instantly share code, notes, and snippets.

@avinayak
Created May 9, 2019 10:01
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 avinayak/e316f574444c3f3c79faea00d7e96b42 to your computer and use it in GitHub Desktop.
Save avinayak/e316f574444c3f3c79faea00d7e96b42 to your computer and use it in GitHub Desktop.
defmodule Solution do
def main do
String.split(IO.read(:stdio, :all), [" ", "\n"])
|> Enum.with_index
|> Enum.filter(fn({_,i}) -> rem(i,2) ==1 end)
|> Enum.map(fn({x,_})->x end)
|> Enum.join("\n")
|> IO.puts
end
end
Solution.main
@avinayak
Copy link
Author

avinayak commented May 9, 2019

Enum.map(&String.to_integer/1)

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