user14788: I'm a beginner and right now rated 1850  in on lichess training; so I'm a very novice player. I try to solve some training examples, and though sometimes I do not feel convinced by the solution given by the computer, I continue. 
 Here is an example where I felt the solution was absolutely wrong. Below are the pictures
 

Why did the computer save the queen rather than killing the knight on g3 with the pawn on h2? 
I thought of this step when solving it but thought it was of no use. But the solution given left me wondering. 

user7473: lichess's puzzles are computer-generated, in the sense that they are selected by an algorithm from positions arising in games between humans. The solution expected is the engine's top choice. In particular, when the engine defends, it picks the best move according to the engine's evaluation.
Thus, in this case, while the most testing move is 16.hxg3, it leads to a worse position (according to the engine's assessment) than 16.Qg2 (assuming best play by both sides), so the engine defends with the latter move instead.
Of course, if this puzzle was given to you by a human, the move given for white would be  16.hxg3, and you would need to show that you found 16...Rf6. But it's not, and the algorithm that generates these puzzles isn't smart enough to differentiate between the best defense, and the most testing response.

user14079: In case of 16.hxg3, Black plays 16...Qxg3+ when White has only two legal moves:

17.Kh1 Rf6 followed by 18...Rh6 is a quick checkmate.
17.Qg2 Qxe3+ and after the check is parried Black can already take back his piece with 18...Qxd3 (with already three extra pawns as a reward), or continue the attack with 18...Rf6. He's completely winning in both cases.

This exercise is a typical case of a demolition sacrifice: you give your knight on g3 to rip the opponent king of its protective pawns and mount a decisive attack.

14788: <p>I'm a beginner and right now rated 1850  in on lichess training; so I'm a very novice player. I try to solve some training examples, and though sometimes I do not feel convinced by the solution given by the computer, I continue. 
 Here is an example where I felt the solution was absolutely wrong. Below are the pictures</p>

<p><img src="https://i.stack.imgur.com/qisn8.png" alt="solution"> </p>

<p><img src="https://i.stack.imgur.com/qEchJ.png" alt="enter image description here"></p>

<p>Why did the computer save the queen rather than killing the knight on g3 with the pawn on h2? </p>

<p>I thought of this step when solving it but thought it was of no use. But the solution given left me wondering. </p>
 7473: <p>lichess's puzzles are computer-generated, in the sense that they are selected by an algorithm from positions arising in games between humans. The solution expected is the engine's top choice. In particular, when the engine defends, it picks the best move according to the engine's evaluation.</p>

<p>Thus, in this case, while the most testing move is 16.hxg3, it leads to a worse position (according to the engine's assessment) than 16.Qg2 (assuming best play by both sides), so the engine defends with the latter move instead.</p>

<p>Of course, if this puzzle was given to you by a human, the move given for white would be  16.hxg3, and you would need to show that you found 16...Rf6. But it's not, and the algorithm that generates these puzzles isn't smart enough to differentiate between the best defense, and the most testing response.</p>
 14079: <p>In case of 16.hxg3, Black plays 16...Qxg3+ when White has only two legal moves:</p>

<ul>
<li><p>17.Kh1 Rf6 followed by 18...Rh6 is a quick checkmate.</p></li>
<li><p>17.Qg2 Qxe3+ and after the check is parried Black can already take back his piece with 18...Qxd3 (with already three extra pawns as a reward), or continue the attack with 18...Rf6. He's completely winning in both cases.</p></li>
</ul>

<p>This exercise is a typical case of a demolition sacrifice: you give your knight on g3 to rip the opponent king of its protective pawns and mount a decisive attack.</p>
