I got both of them.The king has to be submissive.
Sam Lloyd's Chess Puzzle

There's actually a third where the king goes to h4 again in the 2nd puzzle.
In the second puzzle, if the Black king goes back to h4, White's queen just checkmates on h3. Simple.

There's actually a third where the king goes to h4 again in the 2nd puzzle.
In the second puzzle, if the Black king goes back to h4, White's queen just checkmates on h3. Simple.
I knew that, however I was just pointing out the fact that there was a third variation as well.
Puzzle #6: Lonely King on h4 mated in 3 moves
In this puzzle there are two solutions hence there are two puzzles below for each solution. Try and solve. Good luck!