1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# coding=utf-8 id = 124 group = 'sorting' number = 31 visible = True facts = None solution = '''\ pivoting(_, [], [], []). pivoting(P, [H|T], [H|S], G) :- H =< P, pivoting(P, T, S, G). pivoting(P, [H|T], S, [H|G]) :- H > P, pivoting(P, T, S, G). '''