1. Project Overview & Quickstart (doocs/leetcode)
介绍
本项目包含 LeetCode、《剑指 Offer(第 2 版)》、《剑指 Offer(专项突击版)》、《程序员面试金典(第 6 版)》等题目的相关题解。所有题解均由多种编程语言实现,包括但不限于:Java、Python、C++、Go、TypeScript、Rust。我们正在全力更新,欢迎 Star 🌟 关注本项目,获取项目最新动态。
赞助商
| 感谢 APINEBULA 赞助本项目!APINEBULA 是银河录像局旗下的企业级 AI 聚合平台,背靠大平台资源,面向开发者、团队与企业用户提供稳定、高性价比的大模型 API 接入服务。平台聚合 Claude、GPT、Gemini 等主流满血模型,一个接口,接入全球顶尖 AI 大模型,各大模型价格低至 1 折起,支持企业级高并发、正式合同、对公打款与开票服务,适合 AI 编程、Agent 开发、业务系统集成等多种场景!使用此链接注册并在充值时填写 "leetcode" 优惠码可享九折优惠! |
|---|
想出现在这里?如有赞助意向,欢迎添加微信 YLB0109(备注「赞助」)联系洽谈。
站点
算法全解
专项突破
算法提升专题
1. 基础算法
- 在排序数组中查找元素的第一个和最后一个位置 -
二分查找 - 准时到达的列车最小时速 -
二分查找 - 可移除字符的最大数目 -
二分查找 - 排序数组 -
快速排序、归并排序 - 字符串相加 -
高精度加法 - 字符串相乘 -
高精度乘法 - 区域和检索 - 数组不可变 -
前缀和 - 二维区域和检索 - 矩阵不可变 -
二维前缀和 - 区间加法 -
前缀和、差分 - 用邮票贴满网格图 -
二维前缀和、二维差分 - 无重复字符的最长子串 -
双指针、哈希表 - 乘积小于 K 的子数组 -
双指针 - 位 1 的个数 -
位运算、lowbit - 合并区间 -
区间合并
2. 数据结构
- 设计链表 -
单链表、指针引用、数组实现 - 下一个更大元素 I -
单调栈 - 每日温度 -
单调栈 - 子数组的最小值之和 -
单调栈 - 最大宽度坡 -
单调栈 - 最多能完成排序的块 II -
单调栈 - 子数组范围和 -
单调栈 - 子数组最小乘积的最大值 -
单调栈 - 滑动窗口最大值 -
单调队列 - 满足不等式的最大值 -
单调队列 - 和至少为 K 的最短子数组 -
单调队列 - 带限制的子序列和 -
动态规划、单调队列优化 - 单词规律 II -
哈希表、回溯 - 最短回文串 -
字符串哈希 - 回文对 -
字符串哈希 - 最长重复子串 -
字符串哈希、二分查找 - 不同的循环子字符串 -
字符串哈希
3. 搜索
- 图像渲染-
BFS、DFS、Flood Fill 算法、连通性模型 - 岛屿数量 -
BFS、Flood Fill 算法 - 01 矩阵 -
多源 BFS - 地图中的最高点 -
多源 BFS - 进击的骑士 -
BFS、最短路模型 - 二进制矩阵中的最短路径 -
BFS、最短路模型 - 迷宫中离入口最近的出口 -
BFS、最短路模型 - 网格中的最短路径 -
BFS、最短路模型 - 打开转盘锁 -
最小步数模型、双向 BFS、A* 算法 - 单词接龙 -
最小步数模型、双向 BFS - 转化数字的最小运算数 -
最小步数模型、双向 BFS - 滑动谜题 -
BFS、最小步数模型、A* 算法 - 访问所有节点的最短路径 -
BFS、最小步数模型、A* 算法 - 为高尔夫比赛砍树 -
BFS、A* 算法 - 使网格图至少有一条有效路径的最小代价 -
双端队列 BFS - 到达角落需要移除障碍物的最小数目 -
双端队列 BFS - 迷宫 -
DFS、连通性模型、Flood Fill 算法 - 单词搜索 -
DFS、搜索顺序、回溯 - 黄金矿工 -
DFS、搜索顺序、回溯 - 火柴拼正方形 -
DFS、回溯、剪枝 - 划分为 k 个相等的子集 -
DFS、回溯、剪枝 - 完成所有工作的最短时间 -
DFS、回溯、剪枝 - 公平分发饼干 -
DFS、回溯、剪枝 - 矩阵中的最长递增路径 -
DFS、记忆化搜索 - 网格图中递增路径的数目 -
DFS、记忆化搜索 - 翻转游戏 II -
DFS、状态压缩、记忆化搜索 - 统计所有可行路径 -
DFS、记忆化搜索 - 切披萨的方案数 -
DFS、记忆化搜索
4. 动态规划(DP)
- 杨辉三角 -
线性 DP、数字三角形模型 - 最小路径和 -
线性 DP、数字三角形模型 - 摘樱桃 -
线性 DP、数字三角形模型 - 摘樱桃 II -
线性 DP、数字三角形模型 - 最长递增子序列 -
线性 DP、最长上升子序列模型 - 无重叠区间 -
线性 DP、最长上升子序列模型、贪心优化 - 删列造序 III -
线性 DP、最长上升子序列模型 - 俄罗斯套娃信封问题 -
线性 DP、最长上升子序列模型、贪心优化 - 堆叠长方体的最大高度 -
排序、线性 DP、最长上升子序列模型 - 无矛盾的最佳球队 -
排序、线性 DP、最长上升子序列模型 - 最长公共子序列 -
线性 DP、最长公共子序列模型 - 两个字符串的最小 ASCII 删除和 -
线性 DP、最长公共子序列模型 - 两个字符串的删除操作 -
线性 DP、最长公共子序列模型 - 目标和 -
0-1 背包问题 - 分割等和子集 -
0-1 背包问题 - 最后一块石头的重量 II -
0-1 背包问题 - 零钱兑换 -
完全背包问题 - 组合总和 Ⅳ -
完全背包问题 - 从栈中取出 K 个硬币的最大面值和 -
分组背包问题 - 数字 1 的个数 -
数位 DP、记忆化搜索 - 统计各位数字都不同的数字个数 -
数位 DP、记忆化搜索、状态压缩 - 不含连续 1 的非负整数 -
数位 DP、记忆化搜索 - 旋转数字 -
数位 DP、记忆化搜索 - 最大为 N 的数字组合 -
数位 DP、记忆化搜索 - 统计特殊整数 -
数位 DP、记忆化搜索
5. 高级数据结构
- 二维网格图中探测环 -
并查集、检测环 - 除法求值 -
并查集、权值维护 - 由斜杠划分区域 -
并查集、连通分量个数 - 水位上升的泳池中游泳 -
并查集 - 交换字符串中的元素 -
并查集 - 打砖块 -
并查集、逆向思维 - 尽量减少恶意软件的传播 II -
并查集、逆向思维 - 检查边长度限制的路径是否存在 -
并查集、离线思维 - 保证图可完全遍历 -
双并查集 - 区域和检索 - 数组可修改 -
树状数组、线段树 - 通过指令创建有序数组 -
树状数组、线段树 - 统计数组中好三元组数目 -
树状数组、线段树 - 最多 K 次交换相邻数位后得到的最小整数 -
树状数组 - 二维区域和检索 - 可变 -
二维树状数组、线段树 - 计算右侧小于当前元素的个数 -
离散化树状数组、线段树 - 区间和的个数 -
离散化树状数组、线段树 - 翻转对 -
离散化树状数组、分治归并、线段树 - 最长递增子序列的个数 -
离散化树状数组、区间最值问题 - 奇妙序列 -
动态开点线段树、懒标记 - Range 模块 -
动态开点线段树、懒标记 - 我的日程安排表 III -
动态开点线段树、懒标记 - 每天绘制的新区域数量 -
动态开点线段树、懒标记、区间染色模型 - 由单个字符重复的最长子字符串 -
线段树、动态最大子段和模型 - 矩形面积 II -
线段树、离散化、扫描线
6. 图论
- 网络延迟时间 -
最短路、Dijkstra 算法、Bellman Ford 算法、SPFA 算法 - 得到要求路径的最小带权子图 -
最短路、Dijkstra 算法 - 连接所有点的最小费用 -
最小生成树、Prim 算法、Kruskal 算法 - 最低成本联通所有城市 -
最小生成树、Kruskal 算法、并查集 - 水资源分配优化 -
最小生成树、Kruskal 算法、并查集 - 找到最小生成树里的关键边和伪关键边 -
最小生成树、Kruskal 算法、并查集 - 判断二分图 -
染色法判定二分图、并查集
加入我们
刷编程题的最大好处就是可以锻炼解决问题的思维能力。相信我,「如何去思考」 本身也是一项需要不断学习和练习的技能。非常感谢前微软工程师、现蚂蚁金服技术专家 @kfstorm 贡献了本项目的所有 C# 题解。
如果你对本项目感兴趣,并且希望加入我们刷题小分队,欢迎随时提交 PR。请参考如下步骤:
- 将本项目 fork 到你的个人 GitHub 帐户,然后 clone 到你的本地机器;
- 进入 leetcode 目录,切换到一个新的分支;
- 对项目做出一些变更,然后使用 git add、commit、push 等命令将你的本地变更提交到你的远程 GitHub 仓库;
- 将你的变更以 PR 的形式提交过来,项目的维护人员会在第一时间对你的变更进行 review!
- 你也可以参考帮助文档 https://help.github.com/cn 了解更多细节。
Stars 趋势
贡献者
感谢以下所有朋友对本项目的贡献!
版权
本项目著作权归 GitHub 开源社区 Doocs 所有,商业转载请联系 @yanglbme 获得授权,非商业转载请注明出处。
联系我们 & 支持项目
欢迎各位小伙伴们添加 @yanglbme 的个人微信(微信号:YLB0109),备注 「leetcode」。后续我们会创建算法、技术相关的交流群,大家一起交流学习,分享经验,共同进步。
如果你觉得这个项目对你有帮助,也欢迎通过微信扫码赞赏我们 ☕️ ~
许可证
2. Official Technical Reference & Guides (doocs/doocs.github.io)
File: README.md
Introduction
Hello, everyone! Welcome to the Doocs Open Source community. We are currently focusing on sharing various development-related knowledge.
See the 中文文档 for Chinese README.
Sites
Owner
Yang Libin, focus on the inner workings of web applications to build out the "server-side" of web applications.
- Wechat: YLB0109
- Email: [email protected]
- GitHub: https://github.com/yanglbme
- GitCode: https://gitcode.com/yanglbme
- Gitee: https://gitee.com/yanglbme
Projects
Doocs now has the following hot projects:
| # | Project | Description | Popularity |
|---|---|---|---|
| 1 | advanced-java | Core interview questions & answers for experienced Java(Backend) developers. | |
| 2 | leetcode | LeetCode solutions in any programming language. | |
| 3 | source-code-hunter | Source code analysis of frameworks and components. | |
| 4 | jvm | A summary of the underlying principles of Java Virtual Machine. | |
| 5 | coding-interview | A collection of interview questions for programmers. The main contents include ‘Coding Interviews: Questions, Analysis and Solutions’, ‘Beauty of Programming’, etc. | |
| 6 | md | An online wechat markdown editor. | |
| 7 | technical-books | Awesome programming books list. |
How to join
If you want to go fast, go alone. If you want to go far, go together.
I believe many of you have a deep understanding that participating in open source projects is very helpful for personal growth. If you love open source or you are curious about it, join Doocs, work with us, maintain our projects and grow together. You can join us in the following two ways:
- Comment on the relevant discussion on GitHub to express interest in joining the community.
- Send an email to [email protected] with the GitHub ID to request to join the community.
By default, your Doocs membership will be hidden from view aftering joining us. If you'd like to display the organization icon in your profile, you can switch from "Private" to "Public" here: https://github.com/orgs/doocs/people. We also recommend setting it to Public.
Once a member of the community, the member can fork any project of interest and make modifications, and then submit a pull request for review. If the submission is deemed to be in compliance with the project's standards, the member may be added as a collaborator to the project.
It is worth noting that initially, new members may not have direct write access to the projects, as the maintainers need to assess the quality of the submissions. Therefore, it is recommended that new members make submissions regularly to become familiar with the GitHub workflow and to improve their submissions over time.
You can refer to this article if you are a new open-source contributor.
Overall, the Doocs community seems to be a valuable resource for programmers interested in learning about internet backend development and open-source development. The community offers various resources and projects that can help programmers improve their skills and contribute to the open-source community.
Doocs is looking forward to your joining.
Contributors
This organization exists thanks to all the people who contribute.
Contact
File: docs/en/index.md
https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "Doocs"
text: "Developer-friendly Open-source Community"
actions:
- theme: alt
text: GitHub
link: https://github.com/doocs
- theme: brand
text: Enter
link: /en/intro
features:
title: advanced-java
details: Comprehensive guide for Internet Java engineers, covering topics like high concurrency, distributed systems, high availability, microservices, and massive data processing.
icon: 🧠
link: https://github.com/doocs/advanced-javatitle: leetcode
details: Solutions to LeetCode problems implemented in various programming languages, including answers to "Cracking the Coding Interview (6th Edition)" and "Offer in Sword (2nd Edition)".
icon: 🧩
link: https://github.com/doocs/leetcodetitle: source-code-hunter
details: Source code analysis of commonly used Internet component frameworks.
icon: 🔍
link: https://github.com/doocs/source-code-huntertitle: jvm
details: Summary of Java Virtual Machine (JVM) internals and principles.
icon: ⚙️
link: https://github.com/doocs/jvmtitle: coding-interview
details: Coding interview question collections, including problems from Cracking the Coding Interview and Programming Pearls.
icon: 💼
link: https://github.com/doocs/coding-interviewtitle: md
details: A highly minimalist Markdown editor for WeChat.
icon: ✍️
link: https://github.com/doocs/mdtitle: technical-books
details: A list of must-read technical books.
icon: 📚
link: https://github.com/doocs/technical-books
File: docs/en/intro.md
Introduction
Hello, everyone! Welcome to the Doocs Open Source community. We are currently focusing on sharing various development-related knowledge.
Sites
Owner
Yang Libin, focus on the inner workings of web applications to build out the "server-side" of web applications.
- Wechat: YLB0109
- Email: [email protected]
- GitHub: https://github.com/yanglbme
- GitCode: https://gitcode.com/yanglbme
- Gitee: https://gitee.com/yanglbme
Projects
Doocs now has the following hot projects:
| # | Project | Description | Popularity |
|---|---|---|---|
| 1 | advanced-java | Core interview questions & answers for experienced Java(Backend) developers. | |
| 2 | leetcode | LeetCode solutions in any programming language. | |
| 3 | source-code-hunter | Source code analysis of frameworks and components. | |
| 4 | jvm | A summary of the underlying principles of Java Virtual Machine. | |
| 5 | coding-interview | A collection of interview questions for programmers. The main contents include ‘Coding Interviews: Questions, Analysis and Solutions’, ‘Beauty of Programming’, etc. | |
| 6 | md | An online wechat markdown editor. | |
| 7 | technical-books | Awesome programming books list. |
How to join
If you want to go fast, go alone. If you want to go far, go together.
I believe many of you have a deep understanding that participating in open source projects is very helpful for personal growth. If you love open source or you are curious about it, join Doocs, work with us, maintain our projects and grow together. You can join us in the following two ways:
- Comment on the relevant issue on GitHub to express interest in joining the community.
- Send an email to [email protected] with the GitHub ID to request to join the community.
By default, your Doocs membership will be hidden from view aftering joining us. If you'd like to display the organization icon in your profile, you can switch from "Private" to "Public" here: https://github.com/orgs/doocs/people. We also recommend setting it to Public.
Once a member of the community, the member can fork any project of interest and make modifications, and then submit a pull request for review. If the submission is deemed to be in compliance with the project's standards, the member may be added as a collaborator to the project.
It is worth noting that initially, new members may not have direct write access to the projects, as the maintainers need to assess the quality of the submissions. Therefore, it is recommended that new members make submissions regularly to become familiar with the GitHub workflow and to improve their submissions over time.
You can refer to this article if you are a new open-source contributor.
Overall, the Doocs community seems to be a valuable resource for programmers interested in learning about internet backend development and open-source development. The community offers various resources and projects that can help programmers improve their skills and contribute to the open-source community.
Doocs is looking forward to your joining.
Contributors
This organization exists thanks to all the people who contribute.
Contact
File: docs/index.md
https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "Doocs"
text: "开发者友好的开源社区"
actions:
- theme: alt
text: GitHub
link: https://github.com/doocs
- theme: brand
text: 进入
link: /intro
features:
title: advanced-java
details: 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识。
icon: 🧠
link: https://github.com/doocs/advanced-javatitle: leetcode
details: 多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解。
icon: 🧩
link: https://github.com/doocs/leetcodetitle: source-code-hunter
details: 互联网常用组件框架源码分析。
icon: 🔍
link: https://github.com/doocs/source-code-huntertitle: jvm
details: Java 虚拟机底层原理知识总结。
icon: ⚙️
link: https://github.com/doocs/jvmtitle: coding-interview
details: 代码面试题集,包括《剑指 Offer》、《编程之美》等。
icon: 💼
link: https://github.com/doocs/coding-interviewtitle: md
details: 一款高度简洁的微信 Markdown 编辑器。
icon: ✍️
link: https://github.com/doocs/mdtitle: technical-books
details: 值得一看的技术书籍列表。
icon: 📚
link: https://github.com/doocs/technical-books
File: docs/intro.md
介绍
你好呀,欢迎来到 Doocs 开源社区。我们是一个非常友好的技术社区,目前专注于分享技术领域相关知识。
站点
发起人
杨立滨,专注于互联网后端领域。
- 微信: YLB0109
- 邮箱:[email protected]
- GitCode: https://gitcode.com/yanglbme
- Gitee:https://gitee.com/yanglbme
- GitHub: https://github.com/yanglbme
项目
目前 Doocs 有以下多个热门项目,欢迎 Star ⭐ 关注~
| # | 项目 | 描述 | 热度 |
|---|---|---|---|
| 1 | advanced-java | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识。 | |
| 2 | leetcode | 多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解。 | |
| 3 | source-code-hunter | 互联网常用组件框架源码分析。 | |
| 4 | jvm | Java 虚拟机底层原理知识总结。 | |
| 5 | coding-interview | 代码面试题集,包括《剑指 Offer》、《编程之美》等。 | |
| 6 | md | 一款高度简洁的微信 Markdown 编辑器。 | |
| 7 | technical-books | 值得一看的技术书籍列表。 |
如何加入
要走得快,就一个人走;要走得远,就一起走。
参与开源项目,对于个人的成长是有很大帮助的,相信很多小伙伴都有体会。
如果你热爱开源,或者抱着一颗好奇的心,不妨加入 Doocs 组织,和我们一起维护项目,共同成长。可以通过以下两种方式加入:
- 直接在此项目的 issue 上评论,告知我们你想加入 Doocs。
- 发送邮件到 [email protected],写明你的 GitHub ID,如 yanglbme。
默认情况下,在你加入我们之后,你作为 GitHub Doocs 组织成员的信息是处于隐藏状态的。如果你希望在你的个人 GitHub 资料页上展示 Doocs 组织,你可以在此链接 https://github.com/orgs/doocs/people 处将你的信息从 private “私有”改为 public “公开”。当然,我们推荐设置为公开。
注意,刚开始加入,你暂时不会有项目的直接 write 权限,因为我们不确定你的提交是否符合项目规范。
你可以 fork 任何一个感兴趣的项目到你的个人 GitHub 帐户下,对项目作出修改后,提交你的 PR。Doocs 维护者会对你的提交内容进行 review。或许你最初的提交并不规范,这也没关系,改进之后,慢慢的,整个规范性就有了。当你的提交一直很符合项目的规范性,Doocs 维护者会将你添加到对应项目的 Collaborators 列表中,共同维护好项目。
如果你不熟悉 GitHub 操作流程,可以参考这篇文章。
Doocs 期待你的加入。
贡献者列表
感谢以下所有为此开源组织做出贡献的开发者朋友们。
联系我
GitHub 技术社区 Doocs 旗下唯一公众号「Doocs」,欢迎扫码关注,专注分享技术领域相关知识及行业最新资讯。当然,也可以加我个人微信(备注:GitHub),拉你进技术交流群。
File: README_CN.md
介绍
你好呀,欢迎来到 Doocs 开源社区。我们是一个非常友好的技术社区,目前专注于分享技术领域相关知识。
站点
发起人
杨立滨,专注于互联网后端领域。
- 微信: YLB0109
- 邮箱:[email protected]
- GitCode: https://gitcode.com/yanglbme
- Gitee:https://gitee.com/yanglbme
- GitHub: https://github.com/yanglbme
项目
目前 Doocs 有以下多个热门项目,欢迎 Star ⭐ 关注~
| # | 项目 | 描述 | 热度 |
|---|---|---|---|
| 1 | advanced-java | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识。 | |
| 2 | leetcode | 多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解。 | |
| 3 | source-code-hunter | 互联网常用组件框架源码分析。 | |
| 4 | jvm | Java 虚拟机底层原理知识总结。 | |
| 5 | coding-interview | 代码面试题集,包括《剑指 Offer》、《编程之美》等。 | |
| 6 | md | 一款高度简洁的微信 Markdown 编辑器。 | |
| 7 | technical-books | 值得一看的技术书籍列表。 |
如何加入
要走得快,就一个人走;要走得远,就一起走。
参与开源项目,对于个人的成长是有很大帮助的,相信很多小伙伴都有体会。
如果你热爱开源,或者抱着一颗好奇的心,不妨加入 Doocs 组织,和我们一起维护项目,共同成长。可以通过以下两种方式加入:
- 直接在此项目的 discussion 上评论,告知我们你想加入 Doocs。
- 发送邮件到 [email protected],写明你的 GitHub ID,如 yanglbme。
默认情况下,在你加入我们之后,你作为 GitHub Doocs 组织成员的信息是处于隐藏状态的。如果你希望在你的个人 GitHub 资料页上展示 Doocs 组织,你可以在此链接 https://github.com/orgs/doocs/people 处将你的信息从 private “私有”改为 public “公开”。当然,我们推荐设置为公开。
注意,刚开始加入,你暂时不会有项目的直接 write 权限,因为我们不确定你的提交是否符合项目规范。
你可以 fork 任何一个感兴趣的项目到你的个人 GitHub 帐户下,对项目作出修改后,提交你的 PR。Doocs 维护者会对你的提交内容进行 review。或许你最初的提交并不规范,这也没关系,改进之后,慢慢的,整个规范性就有了。当你的提交一直很符合项目的规范性,Doocs 维护者会将你添加到对应项目的 Collaborators 列表中,共同维护好项目。
如果你不熟悉 GitHub 操作流程,可以参考这篇文章。
Doocs 期待你的加入。
贡献者列表
感谢以下所有为此开源组织做出贡献的开发者朋友们。
联系我
GitHub 技术社区 Doocs 旗下唯一公众号「Doocs」,欢迎扫码关注,专注分享技术领域相关知识及行业最新资讯。当然,也可以加我个人微信(备注:GitHub),拉你进技术交流群。