Tusimple - interview question (tech screeing)
1037

Find minimum number of swaps required to get grid from current state to initial state?
grid's current_state =
4 11 15 1
8 9 2 3
6 13 10 12
7 x 5 14

grid's initial state =
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 x

Only element x can swap with another element.

Comments (2)