class Solution { public: string solveEquation(string equation) { int idx = equation.find('='); , v1 = , x2 = , v2 = , idx1 = , idx2 = ; helper(equation.substr(, idx), idx1, x1, v1); helper(equation.substr(idx+), idx2, x2, v2); int x = x1 - x2; int v…