@Primotivo,
I knew that I had to begin his last transaction with him having $5.00 in his pocket so the friend would give him $5.00 to spend (equalling $10) so when he spent the last ten, his pockets would be empty.
So I had to get to $7.50 after subtracting the first ten, so when that was doubled, I'd have fifteen, so when I subtracted the second ten, I'd be left with five. The only number that leaves you 7.5 after subtracting 10 is 17.5 and 17.5 divided in half is 8.75.
So:
$8.75+$8.75 = 17.50-10=7.50+7.50=15-10=5+5=10-10=0