Algorithm to solve linear equation in one variable | Ecency