leetcode README

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

LeetCode

Travis Travis Travis Travis Travis Travis

简体中文 | English


我们的 slogan 是: 只有熟练掌握基础的数据结构与算法,才能对复杂问题迎刃有余。

Star History Chart

🔥🔥🔥 我的《算法通关之路》出版了 🔥🔥🔥

我的新书《算法通关之路》出版了。

图片加载不出来如何解决?

https://github.com/fe-lucifer/fanqiang

力扣专属折扣

力扣免费题目已经有了很多经典的了,也覆盖了所有的题型,只是很多公司的真题都是锁定的。个人觉得如果你准备找工作的时候,可以买一个会员。另外会员很多leetbook 也可以看,结合学习计划,效率还是蛮高的。

现在力扣在每日一题基础上还搞了一个 plus 会员挑战,每天刷题可以获得积分,积分可以兑换力扣周边。

plus 会员挑战

如果你要买力扣会员的话,这里有我的专属力扣折扣:https://leetcode.cn/premium/?promoChannel=lucifer (年度会员多送两个月会员,季度会员多送两周会员)

:calendar:《91 天学算法》限时活动

很多教育机构宣传的 7 天,一个月搞定算法面试的,我大概都了解了下,不怎么靠谱。学习算法这东西,还是要靠积累,没有量变是不可能有质变的。还有的人选择看书,这是一个不错的选择。但是很多人选了过时的或者质量差的书,又或者不会去写书中给的练习题,导致效果很差。

基于这几个原因,我组织了一个 91 天刷题活动,通过一个相对比较长的时间(91 天)给出最新的学习路径,并强制大家打卡这种高强度练习来让大家在 91 天后遇见更好的自己。详细活动介绍可以点下方链接查看。另外往期的讲义也在下面了,大家可以看看合不合你的口味。

最后送给大家一句话: 坚持下去,会有突然间成长的一天。

点此参与

1V1 辅导

如果大家觉得上面的集体活动效率比较低,我目前也接受 1v1 算法辅导,价格根据你的算法基础以及想要学习的内容而定感兴趣的可以加我微信,备注“算法辅导”,微信号 DevelopeEngineer。

:octocat: 仓库介绍

leetcode 题解,记录自己的 leetcode 解题之路。

本仓库目前分为五个部分:

:blue_book: 电子书

注意:这里的电子书并不是《算法通关之路》的电子版,而是本仓库内容的电子版!

在线阅读地址

限时免费下载!后期随时可能收费

可以去我的公众号《力扣加加》后台回复电子书获取!

epub 还是有动图的

另外有些内容只在公众号发布,因此大家觉得内容不错的话,可以关注一下。如果再给 ➕ 个星标就更棒啦!

:meat_on_bone: 仓库食用指南

leetcode-zhihu

(图片来自 leetcode)

其中算法,主要是以下几种:

数据结构,主要有如下几种:

我在网上找到一份 《Interview Cheat Sheet》,这个 PDF 列举了面试的模板步骤。,详细指示了如何一步步完成面试。

这个 pdf 开头就提到了好的代码三个标准:

  1. 可读性
  2. 时间复杂度
  3. 空间复杂度

这写的太好了。

紧接着,列举了 15 算法面试的步骤。比如步骤一:当面试官提问完后,你需要先下来关键点(之后再下面写注释和代码) 看完我的感受就是,面试只要按照这个来做,成功率蹭蹭提升

数据结构与算法的总结

:exclamation: 怎么刷 LeetCode?

:computer: 插件

或许是一个可以改变你刷题效率的浏览器扩展插件。

插件地址:https://chrome.google.com/webstore/detail/leetcode-cheatsheet/fniccleejlofifaakbgppmbbcdfjonle?hl=en-US。

不能访问谷歌商店的朋友可以去我的公众号回复插件获取离线版。强烈推荐大家使用谷歌商店安装, 这样如果有更新可以自动安装,毕竟咱们的插件更新还是蛮快的。

另外大家也可以使用 zerotrac 开发的用于计算力扣中题目分数的网站。这里的分数指的是竞赛分,大家可以根据自己的竞赛分选择稍微比自己竞赛分高一点的题目进行练习,注意这个只是根据通过人数等计算的一个预估分数。地址:https://zerotrac.github.io/leetcode_problem_rating/

精选题解

leetcode 经典题目的解析(200 多道)

这里仅列举具有代表性题目,并不是全部题目

目前更新了 200 多道题解,加上专题涉及的题目,差不多有 300 道。

简单难度题目合集

这里的题目难度比较小, 大多是模拟题,或者是很容易看出解法的题目,另外简单题目一般使用暴力法都是可以解决的。 这个时候只有看一下数据范围,思考下你的算法复杂度就行了。

当然也不排除很多 hard 题目也可以暴力模拟,大家平时多注意数据范围即可。

以下是我列举的经典题目(带 91 字样的表示出自 91 天学算法活动):

中等难度题目合集

中等题目是力扣比例最大的部分,因此这部分我的题解也是最多的。 大家不要太过追求难题,先把中等难度题目做熟了再说。

这部分的题目要不需要我们挖掘题目的内含信息, 将其抽象成简单题目。 要么是一些写起来比较麻烦的题目, 一些人编码能力不行就挂了。因此大家一定要自己做, 即使看了题解 ”会了“,也要自己码一遍。自己不亲自写一遍,里面的细节永远不知道。

以下是我列举的经典题目(带 91 字样的表示出自 91 天学算法活动):

leetcode (azl397985856/leetcode)

Searching Database…

55.7K ·GitHub
What is this?A large, continuously growing collection of worked LeetCode solutions, algorithm and data-structure explainers, Anki flashcard decks, and a 'daily problem' archive, written by the author as he solved problems himself.
Is this a code library, or just a collection of write-ups?It's a curated collection, not an importable library: per-problem explanations with code, topic summaries (sorting, binary search, dynamic programming, union-find, etc.), Anki cards, and an ebook, split into five sections covering solutions, summaries, flashcards, daily problems, and a backlog of planned topics.
How is the content organized, and where should I start?Solutions are grouped by difficulty (easy/medium/hard) and listed by problem number; separate topic pages cover data structures and algorithms like linked lists, trees, binary search, and dynamic programming. The repo content is also available as a free online ebook and paired with a browser extension for practicing directly on LeetCode.
Is this available in English?The README banner offers an English link, but almost all write-ups, summaries, and the companion ebook are written in Simplified Chinese, so non-Chinese readers will need translation for most content.
What languages are the solution code examples written in?Solutions and examples span multiple languages — the repo's topics and codebase list Java, JavaScript, Python, and C++ — since the author writes code in whichever language fits a given problem.
Is there a browser extension that goes with this?Yes, the author built a Chrome extension aimed at making LeetCode grinding more efficient, with an offline download offered through his WeChat account for people who can't reach the Chrome store.
What's the '91-day algorithm challenge' mentioned in the README?It's a structured 91-day study cohort the author runs, giving a paced curriculum and daily check-ins to build algorithm skills steadily, instead of unrealistic 'master it in a week' promises.
Did the author also write a book?Yes — '算法通关之路' (roughly 'The Path to Mastering Algorithms'), a physical and ebook title that builds on the material in this repository, sold separately from the free repo ebook.
Size
123.6 MB
Stars
55.7K
Age
8y
Commits · 90 Days