Skip to content

Instantly share code, notes, and snippets.

@oleander
Created March 15, 2011 22:22
Show Gist options
  • Save oleander/871638 to your computer and use it in GitHub Desktop.
Save oleander/871638 to your computer and use it in GitHub Desktop.
-module(main).
-compile(export_all).
% [{1,3}, {2,1}] => [{2,1}]
input(Xs) -> helper(Xs, []).
helper([], Xs) -> Xs;
helper([{First, Last} | L], Xs) when First > Last -> helper(L, [{First, Last} | Xs]);
helper([_| L], Xs) -> helper(L, Xs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment