Because the equations have solutions, r(A)=r(A, b).
Since A has only two columns, R (a) = R (a, b).
So determinant |A, b| = 0.
[ 1, - 1, 2]
[ 1, 2, 1]
[ 3,k, 1]
= k- 12
So k = 12.