{"size": 743, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "PavelSab/advanced-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": "PavelSab/advanced-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": "PavelSab/advanced-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": 15.8085106383, "max_line_length": 55, "alphanum_fraction": 0.3755047106}
module.exports = function getZerosCount(number, base) {
  let j = 0;
  let i = 2;
  let count = 0;
  let f = 0;
  let p = [];
  let q = [];
  let c = [];

  do {
    if (base % i === 0) {
      base = base / i;
      count++;
      f = 1;
    }
    else {
      if (f === 1) {
        p[j] = i;
        q[j] = count;
        j++;
      }
      i++;
      count = 0;
      f = 0;
    }
  }
  while (i <= base);
  p[j] = i;
  q[j] = count;
  for (i = 0; i < p.length; i++) {
    let n = 1;
    c[i] = 0;

    while (n <= number) {
      n = n * p[i];
      c[i] = c[i] + Math.floor(number / n);
    }
  }

  let zeros = c[0] / q[0];
  for (i = 0; i < q.length; i++) {
    zeros = Math.min(zeros, Math.floor(c[i] / q[i]));
  }


  return zeros;
}