aboutsummaryrefslogtreecommitdiff
path: root/problem24.erl
blob: 8c0d4eba3ad125ec3a307bef64244395f06be23d (plain)
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
-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
		]
	).