{"size": 714, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "mikhailnakanechny/quadratic-equation", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "mikhailnakanechny/quadratic-equation", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "mikhailnakanechny/quadratic-equation", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.4444444444, "max_line_length": 66, "alphanum_fraction": 0.5280112045}
module.exports = function solveEquation(equation) {
  // your implementation
    // const solutions = solveEquation('2 * x^2 - 10 * x + 12');
    //   console.log(solutions); // [2, 3]

    str=equation.replace(/[' *]/g, '');
    str=str.replace('^2','');

    var arrSplit = str.split('x');
    var arrOut =[];

    var a = +arrSplit[0];
    var b = +arrSplit[1];
    var c = +arrSplit[2];

  //  console.log(' a: ' + a + ' b: ' + b +' c: '+ c);

    arrOut[0] = Math.round((-b-Math.sqrt(b*b-4*a*c))/(2*a));
    arrOut[1] = Math.round((-b+Math.sqrt(b*b-4*a*c))/(2*a));

    arrOut=arrOut.sort(function(x,y){return x-y;});

    return arrOut;

 //   console.log(' x1: '+ arrOutput[0] + ' x2: ' + arrOutput[1]);
};
