To solve for this, we will create a system of equations.
x + y = 15
x = y + 3
Let's try numbers that add up to 15.
I will try 6 and 9, 9 for x, 6 for y.
6 + 9 = 15
9 = 6 + 3
These system of equations works!
Since x is your friend's lunch, y is yours.
You spent $6.
I hope this helps!