fork download
  1. zipn(List) ->
  2. zipn([],List).
  3.  
  4. zipn(Acc,[]) ->
  5. lists:map(fun lists:reverse/1,Acc);
  6. zipn([],[A|Rest]) ->
  7. AccStart = [[V] || V<-A],
  8. zipn(AccStart,Rest);
  9. zipn(Acc,[A|Rest]) ->
  10. NewAcc = zipn_helper(Acc,A),
  11. zipn(NewAcc,Rest).
  12.  
  13. zipn_helper(Acc,A) ->
  14. zipn_helper([],Acc,A).
  15.  
  16. zipn_helper(Acc,[],[]) ->
  17. lists:reverse(Acc);
  18. zipn_helper(Acc,[AccHd|AccRest],[VHd|VRest]) ->
  19. NewAccHd = [VHd|AccHd],
  20. NewAcc = [NewAccHd|Acc],
  21. zipn_helper(NewAcc,AccRest,VRest).
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty