Solve the Equation
Given a string representing an equation, you need to solve the equation and find the value of the variable 'x'. The equation contains only '+', '-', operation, the variable 'x' and its coefficient. If there is no solution for the equation, return -1. If there are infinite solutions for the equation, return 0. If there is exactly one solution for the equation, return the value of 'x'
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)