push_swap
Sorting, in the fewest moves.

Sorting integers with two stacks and a limited set of instructions, in as few operations as possible.
The problem
Sorting is easy until the only moves allowed are swap, push and rotate on two stacks, and every move counts against you.
How I built it
- 01Implements the 11 operations (sa, sb, ss, pa, pb, ra, rb, rr, rra, rrb, rrr) on two stacks.
- 02An optimized strategy that keeps the instruction count low, even for large inputs.
- 03Validates input: no duplicates, no overflow, no non-numbers.
Key takeaways
- — Algorithmic complexity measured in real operations, not just in theory.
- — Optimizing against a benchmark.
push_swap was built as part of the software engineering curriculum at 1337 Coding School (42 Network, UM6P), where every project is built from scratch and reviewed by peers.