leetcode README

The project's README from github.com/soulmachine/leetcode. As one markdown file: README.md.

LeetCode题解

在线阅读

https://algorithm-essentials.soulmachine.me/

PDF下载

LeetCode题解(C++版).pdf

C++ 文件夹下是C++版,内容一模一样,代码是用C++写的。

Java 文件夹下是Java版,目前正在编写中,由于拖延症,不知道猴年马月能完成。

如何编译PDF

命令行编译

docker run -it --rm -v $(pwd)/C++:/project -w /project soulmachine/texlive xelatex -interaction=nonstopmode leetcode-cpp.tex

vscode下编译

本项目已经配置好了vscode devcontainer, 可以在 Windows, Linux 和 macOS 三大平台上编译。

用 vscode 打开本项目,选择右下角弹出的 "Reopen in Container",就会在容器中打开本项目,该容器安装了 Tex Live 2022 以及所需要的10个字体。

点击vscode左下角的齿轮图标,选择 Command Palette,输入tasks, 选择 Run Task, 选择 leetcode-C++,即可启动编译。

LaTeX模板

本书使用的是陈硕开源的模板。这个模板制作精良,感谢陈硕 :)

这个LaTex模板总共使用了10个字体,下载地址 https://pan.baidu.com/s/1eRFJXnW 。有的字体Windows自带了,有的字体Ubuntu自带了,但都不全,还是一次性安装完所有字体比较方便。

也可以参考 Dockerfile 去学习如何安装所有字体。

贡献代码

欢迎给本书添加内容或纠正错误,在自己本地编译成PDF,预览没问题后,就可以发pull request过来了。

leetcode (soulmachine/leetcode)

Searching Database…

11.3K ·GitHub
What is this?A free book of fully worked LeetCode solutions covering 151 problems, written and typeset in LaTeX with C++ code (a Java edition is also in progress).
Is this a code library or a book I read as a PDF?It's a LaTeX book project: the content compiles into a PDF, and the solution code (in the C++ folder) is meant to be read alongside the explanations, not imported as a library.
What do I need installed to compile it?You need a LaTeX distribution (the devcontainer uses TeX Live 2022) plus the 10 specific fonts the book's template requires; the Dockerfile shows exactly how to install them all.
Is the Java version of the solutions finished?No — only the C++ edition is complete; the Java folder is still being written, and the author jokingly admits procrastination means there's no ETA for it.
Who is this book aimed at?Programmers preparing for coding interviews who want full LeetCode problem write-ups with working C++ solutions rather than just answer keys.
What LaTeX template does the book use?It uses an open-source LaTeX template created by Chen Shuo (陈硕), which the author credits as well-crafted.
How many problems are covered in the finished C++ edition?All 151 LeetCode problems have complete C++ solutions and write-ups.
Do I need to find the 10 template fonts myself?Not if you use the devcontainer, which already has them installed; otherwise you'd need to download and install all 10 fonts referenced in the README (or follow the Dockerfile as a guide).
Size
39.5 MB
Stars
11.3K
Updated
CommitJul 10
Age
13y
Commits · 90 Days