From 0248ed34ce3d05228bc5084669c3a27933be0c2e Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Sun, 4 Oct 2009 00:56:56 +0100 Subject: first commit --- problem40.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 problem40.erl (limited to 'problem40.erl') diff --git a/problem40.erl b/problem40.erl new file mode 100755 index 0000000..d2299af --- /dev/null +++ b/problem40.erl @@ -0,0 +1,11 @@ +-module(problem40). +-export([solve/0]). +-import(lists,[nth/2,flatten/1,map/2,seq/2]). + +solve() -> + N = onenum(), + t(1,N)*t(10,N)*t(100,N)*t(1000,N)*t(10000,N)*t(100000,N)*t(1000000,N). + +onenum() -> flatten(map(fun(X) -> integer_to_list(X) end, seq(1,400000))). + +t(N,L) -> nth(N,L) - 48. -- cgit v1.2.1