Algorithm · Microsoft · Hard
Examples Example Requirements You are given a $$4\times 4$$ grid holding tiles 1..15 plus a single empty cell, represented by 0. A legal action moves a tile adjacent to the empty cell horizontally or vertically into that empty cell. The target arrangement places 1..15 in row-major sequence, with 0 located at (3, 3). Determine the fewest legal moves needed to transform the supplied board into that target arrangement. Return -1 when the target cannot be reached. In the HE…
Checking your access…