Our solution: The goalkeeper is carelessly fouling the attacking player inside the penalty area and thus stops a promising attack (an obvious goal-scoring opportunity is not denied). The contact results from a genuine attempt to play the ball and should be therefore only punished by a penalty kick. A yellow card is not needed.
Our solution: The defender is carelessly tripping the attacker and thus stops a promising attack inside the penalty area. As he genuinely attempts to play the ball, a yellow card is not necessary.