It's not clear what you mean by expansivity from the units. The usual expansion coefficient is (1/V)(dV/dT) which has units of K-1. Another possibility is a linear volumetric coefficient of expansion like V = V0 + V0β(T-T0) (also with K-1 units. Finally the expansivity could be the volume change/temperature change in unit of liters/K.
In the first, dV = VαdT or integrating we obtain ln(V/V0) = α(T-T0)
In the second V = V0(1 + α(T-T0))
Either way you set nout/n0 = (V-V0)/V0 at constant pressure
In the second case this works nicely to 5g/27g = V0α(T-T0)/V0 = α(T-T0) and you can solve for T
Please consider a tutor. Take care.