Given a string equation representing a linear equation, solve the equation and return the value of x as a string.
The result should be formatted as follows:
If the equation has a single unique solution, return "x=#", where # represents the integer value of x.
If the equation has infinitely many solutions, return "Infinite solutions".
If the equation has no solution, return "No solution".
Constraints:
equation.length
equation has exactly one '='.
equation consists of integers with an absolute value in the range 'x'.
The input is generated such that if there is a single solution, it will be an integer.
Given a string equation representing a linear equation, solve the equation and return the value of x as a string.
The result should be formatted as follows:
If the equation has a single unique solution, return "x=#", where # represents the integer value of x.
If the equation has infinitely many solutions, return "Infinite solutions".
If the equation has no solution, return "No solution".
Constraints:
equation.length
equation has exactly one '='.
equation consists of integers with an absolute value in the range 'x'.
The input is generated such that if there is a single solution, it will be an integer.