Returns the sorted list formed by merging all the sub-lists of ListOfLists. All these sub-lists must be sorted prior to evaluating this function. When two elements compare equal, the element from the sub-list with the lowest position in ListOfLists is picked before the other element.
ListsofLists − Collection of Lists which need to be merged.
Returns the merged list of elements.
-module(helloworld). -import(lists,[merge/1]). -export([start/0]). start() -> io:fwrite("~w~n",[merge([,,])]).
When we run the above program, we will get the following result.