Your approach is perfectly valid, but incomplete.
Let X be the % of salt
Let Y be the % of sugar
In your solution these are not mass percentages, but molar fractions. That's OK, and the equation you used is valid. However, your final answer is also given as a molar fraction, when the question asks for mass fraction - hence the discrepancy.