>>7614454Your method is fine but the last expression means that it can't have the form {a,0;0,b} as the problem suggests.
A better method would probably be to realize that the equation in a. implies that AM=MB where B={a,0;0,b}.
In this case that would mean that
AM={3,3l+1;1,l+3}={a,lb,0,b}=MB
Which is better because you don't have to calculate any inverses.