{"size": 680, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "KirylDv/zeros", "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": "KirylDv/zeros", "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": "KirylDv/zeros", "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": 21.25, "max_line_length": 65, "alphanum_fraction": 0.5852941176}
function factorial(num){
  if (num <= 1n)
    return 1n;
  return factorial(num-1n) * num;
}

function double_factorial(num){
  if (num <= 1n)
    return 1n;
  return double_factorial(num-2n) * num;
}

module.exports = function zeros(expression) {
  let a = expression.split("*");
  let resultNum = 1n;
  a.forEach(elem => {
    if (elem[elem.length-2] === "!")
      resultNum *= double_factorial( BigInt(elem.slice(0, -2)) );
    else
      resultNum *= factorial( BigInt(elem.slice(0, -1)) );
  });
  a = String(resultNum);
  resultNum = 0;
  console.log(a);
  for (let i = a.length-1; i > 0; i--) {
    if(a[i] !== "0")
      break;
    resultNum++;
  }
  return resultNum;
}
