erlang - Pick larger number from two lists -
i want pick numbers 2 lists of same size list. larger numbers gets picked.
for example:
[1,2,3,4] , [5,5,0,1] ----> [5,5,3,4]
is there elegant way in erlang this? using list comprehensions maybe?
lists:map(fun({f,s}) -> max(f, s) end, lists:zip(l1, l2)).
Comments
Post a Comment