Created
May 9, 2019 10:01
-
-
Save avinayak/e316f574444c3f3c79faea00d7e96b42 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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enum.map(&String.to_integer/1)