Assume that solution with 20% and 50% salt is x and y gallons respectively.
Therefore,
x+y = 300 => y=300-x
Additionally
20x+50y = 300*41 = 12300
Substituting for y
20x+50(300-x) = 12300 => 20x+15000-50x = 123000 => -30x = -2700
x= 90 gallons
y= 300-x = 300 - 90 =210 gallons