aboutsummaryrefslogtreecommitdiff
path: root/problem24.erl
diff options
context:
space:
mode:
authorNathan Lasseter <nathan.je.lasseter@googlemail.com>2009-10-04 00:56:56 +0100
committerNathan Lasseter <nathan.je.lasseter@googlemail.com>2009-10-04 00:56:56 +0100
commit0248ed34ce3d05228bc5084669c3a27933be0c2e (patch)
treeb9c4990344b0863a2af851b5917c49f3a5f03e6b /problem24.erl
parent00686037d57eb0a0d5eba6eeb6fcc9692e8b59f6 (diff)
first commit
Diffstat (limited to 'problem24.erl')
-rwxr-xr-xproblem24.erl28
1 files changed, 28 insertions, 0 deletions
diff --git a/problem24.erl b/problem24.erl
new file mode 100755
index 0000000..8c0d4eb
--- /dev/null
+++ b/problem24.erl
@@ -0,0 +1,28 @@
+-module(problem24).
+-export([solve/0]).
+
+solve() ->
+ L = lists:seq(0,9),
+ lists:nth(1000000,
+ [{A,B,C,D,E,F,G,H,I,J} ||
+ A <- L,
+ B <- L,
+ C <- L,
+ D <- L,
+ E <- L,
+ F <- L,
+ G <- L,
+ H <- L,
+ I <- L,
+ J <- L,
+ B=/=A,
+ C=/=A, C=/=B,
+ D=/=A, D=/=B, D=/=C,
+ E=/=A, E=/=B, E=/=C, E=/=D,
+ F=/=A, F=/=B, F=/=C, F=/=D, F=/=E,
+ G=/=A, G=/=B, G=/=C, G=/=D, G=/=E, G=/=F,
+ H=/=A, H=/=B, H=/=C, H=/=D, H=/=E, H=/=F, H=/=G,
+ I=/=A, I=/=B, I=/=C, I=/=D, I=/=E, I=/=F, I=/=G, I=/=H,
+ J=/=A, J=/=B, J=/=C, J=/=D, J=/=E, J=/=F, J=/=G, J=/=H, J=/=I
+ ]
+ ).