-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF.exs
More file actions
35 lines (32 loc) · 666 Bytes
/
F.exs
File metadata and controls
35 lines (32 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
defmodule Main do
def readInt do
""
|> IO.gets
|> String.trim
|> String.split
|> Enum.map(&String.to_integer/1)
end
def tira(str, pat) do
oi = String.split(str, pat)
if Enum.count(oi) == 1 do
hd(oi)
else
hd(tl(oi))
end
end
def main do
[t] = readInt()
oi = Enum.reduce(1..t, MapSet.new, fn(_, acc) ->
str = "" |> IO.gets |> String.trim
str = tira(str, "://")
str = tira(str, "@")
x = hd(String.split(str, "/"))
MapSet.put(acc, x)
end)
for x <- MapSet.to_list(oi) do
IO.puts(x)
end
# IO.inspect(MapSet.to_list(oi))
end
end
Main.main()