equation in one variable x. Each side is a sum of terms joined by + and -; a term is a non-negative integer or x with an optional coefficient in front of it (x, 0x, 7x). The first term on a side may also carry a sign.
Solve the equation and return:
- "x=<value>" if there is exactly one solution (it is guaranteed to be an integer);
- "No solution" if there are no solutions;
- "Infinite solutions" if every x works.equation="3x-7=x+5" → 'x=6'
Moving terms across gives 3x − x = 5 + 7, so 2x = 12 and x = 6.
equation="x+x-4=2x" → 'No solution'
The left side is 2x − 4 and the right side is 2x; x cancels out and leaves −4 = 0, so there is no solution.
equation="10-x=10-x" → 'Infinite solutions'
Both sides are identical, so every x works.
equation has exactly one = and both sides are non-emptyequation consists of digits, +, - and xequation="3x-7=x+5"
'x=6'
Run checks the first 3 tests in your browser. Submit checks all 193 tests on the server, hidden ones included.