Jump to content

Department numbers: Difference between revisions

Added Elixir Solution
(Added Elixir Solution)
Line 820:
SOLUTION #14: 7 4 1
</pre>
 
=={{header|Elixir}}==
<lang elixir>
IO.puts("P - F - S")
for p <- [2,4,6],
f <- 1..7,
s <- 1..7,
p != f and p != s and f != s and p + f + s == 12 do
"#{p} - #{f} - #{s}"
end
|> Enum.each(&IO.puts/1)
 
</lang>
<lang elixir>
P - F - S
2 - 3 - 7
2 - 4 - 6
2 - 6 - 4
2 - 7 - 3
4 - 1 - 7
4 - 2 - 6
4 - 3 - 5
4 - 5 - 3
4 - 6 - 2
4 - 7 - 1
6 - 1 - 5
6 - 2 - 4
6 - 4 - 2
6 - 5 - 1
</lang>
 
=={{header|F_Sharp|F#}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.