I'm not 100% sure, but imma have a go.
Answer:
a = 261; b = 253
Explanation:
label candy bar A as a
label candy bar B as b
Make 2 equations.
2b + a = 767 (1)
b + 2a = 775 (2)
Solve for a in (1)
2b + a = 767 (-2b)
a = -2b + 767
Substitute for into (2)
b + 2( -2b + 767 ) = 775 (flip)
2( -2b + 767 ) + b = 775 (solve)
−4b + 1534 + b = 775 (add b)
-3b + 1534 = 775 (subtract 1534 from both sides)
−3b = −759 (divide both sides by 3)
b = 253
Substitute b into (1)
a = -2b + 767 (substitute)
a = -2 (253) + 767 (solve)
a = -506 + 767 (add)
a = 261