Tile-Stack Merge Game

Asked at Google · Coding Questions · Difficulty: Medium · Last asked Dec 29, 2025

Two players play a stacking game on a table of coloured tiles. A position is a collection of stacks; on each turn the player to move merges two stacks into one, and the player who has no legal merge loses. Implement the game rules and a solver that decides who wins from a given position.

Loading the problem…