This is a riddle where the left-hand side represents the amount spent and the right-hand side represents the balance.
We have that:
[tex]\text{Total Spent+Current Balance=50}[/tex]Adding the values in the balance column is not really necessary; in fact, it is coincidental in this case that the balances add up to 51.