
This is a sorting algorithm challenge from 42 school. The goal is to sort a stack of integers using only a limited set of stack operations, using as few moves as possible.
Implement a program that takes a list of integers and sorts them using two stacks (a
and b
) and a limited set of operations (sa
, pb
, ra
, etc.). The goal is to produce the smallest number of instructions possible.