To solve we use a formula analogous to the formula relating to atomic mass of isotopes of elements to their relative abundance.
molar mass of H2O = 18 g/mol fraction of H2O in the sample = 50% = 0.5
molar mass of D2O = 20 g/mol (contains one extra neutron than H for each of the two D atoms) fraction of D2O = 0.5
Substituting the values,
molar mass of sample = 18 0.5 + 20 0.5 = 9 + 10 = 19 g/mol