There's a neater way to solve this, by tracking the silver instead of the gold, since silver never changes.
Silver in the original 50 gms of alloy is $20\%$ of 50, which is 10 gms. Adding pure gold does not change this 10 gms of silver at all.
After adding $x$ gms of gold, gold is 90% of the new mixture, so silver must be the remaining $10\%$ of the new mixture.
That gives the equation $10 = \frac{10}{100} \times (50 + x)$, so $50 + x = 100$, which means $x = 50$.
Let's summarize:
This confirms option A, 50 gms, without ever writing an equation in terms of gold.