MCPcopy
hub / github.com/doocs/leetcode / generate_contest_readme

Function generate_contest_readme

solution/util.py:488–498  ·  view source on GitHub ↗
(result: List)

Source from the content-addressed store, hash-verified

486
487
488def generate_contest_readme(result: List):
489 result.sort(key=lambda x: -x[0])
490 content_cn = "\n\n".join(c[1] for c in result)
491 content_en = "\n\n".join(c[2] for c in result)
492 metadata_section = "---\ncomments: true\n---"
493 content_cn = contest_readme_cn.format(metadata_section, content_cn)
494 with open("./CONTEST_README.md", "w", encoding="utf-8") as f:
495 f.write(content_cn)
496 content_en = contest_readme_en.format(metadata_section, content_en)
497 with open("./CONTEST_README_EN.md", "w", encoding="utf-8") as f:
498 f.write(content_en)

Callers 1

runFunction · 0.85

Calls 2

formatMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected