Deviopath › Karel

Biggest Pile Last

Hard · Algorithms

The row has piles of balls. Move the biggest pile to the last square. The other piles slide one square to the left to fill the gap, keeping their order.

For example 2 5 1 3 becomes 2 1 3 5. There is always exactly one biggest pile. Your code runs in several worlds.

Next: Bigger Pile Wins