{"size": 493, "ext": "js", "max_stars_repo_path": "facetoface/suanfa/reportData.js", "max_stars_repo_name": "yang3406/codeDemo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "facetoface/suanfa/reportData.js", "max_issues_repo_name": "yang3406/codeDemo", "max_issues_repo_issues_event_min_datetime": "2020-07-16T22:07:22.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-23T05:24:58.000Z", "max_forks_repo_path": "facetoface/suanfa/reportData.js", "max_forks_repo_name": "yang3406/codeDemo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 9, "max_forks_count": null, "avg_line_length": 30.8125, "max_line_length": 111, "alphanum_fraction": 0.5659229209}
// 报数 1 被读作 "one 1" ("一个一") , 即 11。 11 被读作 "two 1s" ("两个一"）, 即 21。 21 被读作 "one 2","one 1"（"一个二", "一个一"), 即 1211

function countAndSay(n) {
  if (n === 1) return '1';
  var preResult = countAndSay(n - 1);
  return preResult.replace(/(\d)\1*/g, item => `${item.length}${item[0]}`)
}

function countAndSay2(n) {
  let preResult = '1';
  for (var i = 1; i < n; i++) {
    preResult = preResult.replace(/(\d)\1*/g, item => `${item.length}${item[0]}`)
  }
  console.log(preResult);
}
countAndSay(4);