Solving a linear equation with zero, one, or an infinite number of solutions