One way to do an undo is to make a save of the game state before you move. It's the same kind of problem as saving your game, you probably can utilize construct's save features for that. Another way is to just save the changes of each move. Could be a bit trickier though.
Hints would be done in the same way as a real player finds a move. Basically come up with a way to check all possible moves.