If the equation x ^ 2-4x + 3M = 0 has the same root as x ^ 2-x-6m = 0, find M

If the equation x ^ 2-4x + 3M = 0 has the same root as x ^ 2-x-6m = 0, find M

There is a second formula, x ^ 2 = x + 6m
Substituting 1 formula x + 6m-4x + 3M = 0
x=3m
Substituting formula 2 (3m) ^ 2-3m-6m = 0
M = 0 or M = 1
After testing, M = 0, M = 1 are consistent with the meaning of the question
So m = 0 or M = 1