-module(solution). -export([main/0]). % the pattern looks trs Sierpinski main() -> {ok, [N]} = io:fread("", "~d"), L = read_list(N), A = to_map(L), io:format("~p~n", [maps:size(A)]), print(A), true. to_map(L) -> N = length(L), Z = lists:zip(lists:seq(0, N-1), L), maps:from_list(Z). s(N) -> (N*(N+1)) div 2. print(_A) -> 42. read_list(N) -> Fmt = unicode:characters_to_list(lists:duplicate(N, "~s")), {ok, L} = io:fread("", Fmt), L.