My solution is the same, your algebra looks fine. This problem can be generalized:

blackjack

flooble's webmaster puzzle