Internal energy is a state variable, so ΔU from P to Q is the same along both paths. Let the work done by the system along path 2 be W2; then along path 1 it is W2+100 J.
Path 1: 1000=ΔU+(W2+100), so ΔU+W2=900 J.
Path 2: Q2=ΔU+W2=900 J.
So 900 J of heat is given to the system along path 2. Less heat is needed because the system does 100 J less work along this path, which lies lower on the diagram and so has a smaller area under it.