Skip to content

Instantly share code, notes, and snippets.

View MinCha's full-sized avatar

Min Cha MinCha

  • GGtics
  • Gwanggyo
View GitHub Profile
@eungju
eungju / p1_2.erl
Created August 31, 2012 07:31
문제로 풀어보는 알고리즘 149쪽 문제 3.c 풀이
-module(p1_2).
-compile(export_all).
s([_]=L) ->
[[L]];
s([A|L]) ->
S = s(L),
lists:append([lists:map(fun(X) -> [[A]|X] end, S)|lists:map(fun(X) -> each_append(A,X) end, S)]).
each_append(_, [], _, Acc) ->