The first law of thermodynamics says that the variation of internal energy of a system is given by:
where Q is the heat delivered by the system, while W is the work done on the system.
We must be careful with the signs here. The sign convention generally used is:
Q positive = Q absorbed by the system
Q negative = Q delivered by the system
W positive = W done on the system
W negative = W done by the system
So, in our problem, the heat is negative because it is releaed by the system:
Q=-1275 J
while the work is positive because it is performed by the surrounding on the system:
W=+855 J
So, the variation of internal energy of the system is