Problem 1240 · Hard

Tiling a Rectangle with the Fewest Squares

Fill the first empty cell with the largest fitting square, backtrack over sizes, and prune any branch that cannot beat the best count.

Open the interactive visualisation