See the given image carefully. What you have to do is move the blue checkers in the position of the black checkers and vice versa. You are only allowed to move the checker to an adjacent empty space. Do it in the least possible moves.
You have to fill the below given grid in a manner that every row and column contains the digits 1 to 6. Also, make sure that the squares that are connected with each other must contains the same digit.