Let total money Gopal has = $M$.
Price of one orange = $\frac{M}{50}$, price of one mango = $\frac{M}{40}$.
He retains 10% of $M$ for taxi fare, so the amount available for buying fruits = $0.9M$.
If he buys 20 mangoes, cost = $20 \times \frac{M}{40} = 0.5M$.
Money left after buying 20 mangoes = $0.9M - 0.5M = 0.4M$.
Now, price of one orange = $\frac{M}{50}$, so number of oranges he can buy with $0.4M$ =
$\frac{0.4M}{M/50} = 0.4 \times 50 = 20$ — Wait, this gives 20, but the given answer key says 18, so let's recheck assumptions.
Possibility: The 10% taxi fare is taken after fruit purchase? Or perhaps the proportionate reduction applies to both? Another interpretation: He plans to buy 20 mangoes and as many oranges as possible within the remaining 90% of the total money. But the taxi fare is taken from the fruit money directly, so the ratio changes. If the intended condition is different, re-checking data is needed.