Open-source project
huxiaoman7/leetcodebook avatar
huxiaoman7/leetcodebook

leetcodebook: a topic index over LeetCode problems 1 to 400

leetcode 1~400知识点&题型总结&leetcode对应题表

588 stars142 forksPythonLicense varies

At a glance

What is it?
leetcodebook is a study repository that groups LeetCode problems by the technique they need, with knowledge notes per data structure and solutions in Python, Java and C++. It is a Chinese language resource and it is organised around problem numbers, which is both its strength and its limit.
Who is it for?
leetcodebook suits a Chinese speaking learner who wants the problems arranged by idea rather than by number, and who wants runnable solutions in more than one language. It does not suit someone who needs coverage of problems beyond the 1 to 400 range, and it does not replace a textbook, because the notes are summaries rather than derivations.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 106 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A knowledge summary and a problem index in one repository

The repository description is the whole pitch: a summary of LeetCode problems 1 to 400, a summary of topic knowledge and problem types, and a table mapping those topics to the corresponding LeetCode problems. The README is written in Chinese, and the topic tags are algorithms-datastructures and leetcode.

The top level of the tree shows how it is arranged. There are four data structure folders, Array/, Linklist/, Queue/ and Stack/, and then five language folders for the code, c++/, java/, python/, shell/ and sql/, alongside a tests/ directory and the README itself.

That split is the design. The four folders hold the thinking material, the notes that explain why a family of problems is solved the way it is, and the language folders hold the code. A reader who wants to understand the idea reads a note, and a reader who wants to see it working opens the solution in whichever language they are practising in.

The primary language recorded for the repository is Python, which fits, since the language directories are a set and Python is the one the author most likely wrote first.

Every table row carries number, problem, difficulty and languages

The problem tables have four columns, and the layout is consistent enough to read at a glance. The first is the problem number, the second is the problem title as a link to leetcode.com, the third is the difficulty, and the fourth lists the languages in which a solution is available.

The array section opens with the K-SUM family, where the pattern is that the number of elements summed grows while the technique stays the same. The rows run from problem 1, Two Sum, marked easy, through 167, Two Sum II with a sorted input, 15, 3Sum, 16, 3Sum Closest, 259, 3Sum Smaller, and 18, 4Sum. All of them are marked as having solutions in python, java and c++.

Then come the interval problems, with 56 Merge Intervals, 57 Insert Interval marked hard, 252 Meeting Rooms, 253 Meeting Rooms II and 352 Data Stream as Disjoint Intervals marked hard.

The subarray group is the largest in the excerpt shown, with 78 Subsets, 90 Subsets II, 53 Maximum Subarray, 152 Maximum Product Subarray, 239 Sliding Window Maximum, 295 Find Median from Data Stream, 228 Summary Ranges, 163 Missing Ranges, 325 Maximum Size Subarray Sum Equals k, 209 Minimum Size Subarray Sum, 238 Product of Array Except Self and 128 Longest Consecutive Sequence.

The remaining categories in the excerpt are the rotate problems, 48 Rotate Image, 89 Search in Rotated Sorted Array, 189 Rotate Array and 81 Search in Rotated Sorted Array II, and the array sorting group, which includes 88 Merge Sorted Array, 75 Sort Colors, 283 Move Zeroes, the wiggle sort family of 376, 280 and 324, 215 Kth Largest Element in an Array, 287 Find the Duplicate Number, 334 Increasing Triplet Subsequence, 400 Nth Digit, 387 First Unique Character in a String, 164 Maximum Gap, 347 Top K Frequent Elements and 243 Shortest Word Distance.

Difficulty and language columns are the practical filters

Two of the four columns turn the index into something you can actually plan with.

The difficulty column records the level LeetCode assigns, and it is what tells you how much of the table to attempt in one sitting. In the excerpt, 1 Two Sum and 53 Maximum Subarray are easy, 15 3Sum and 88 Merge Sorted Array sit in the middle, and 57 Insert Interval, 352 Data Stream as Disjoint Intervals and 164 Maximum Gap are hard. Because the categories group problems that share a technique, the difficulty spread inside one category is a real signal: the K-SUM family starts easy and ends medium, while the interval family runs from easy to hard.

The language column is the other filter, and it is the one that determines whether the code is there for you. Every row in the excerpt lists python, java and c++, so for those families the choice is yours. The presence of shell/ and sql/ in the tree suggests some problems are answered with a database query or a one-liner rather than an application language, which is a useful piece of information for problems whose statement is really about SQL rather than about algorithms.

The consequence for a reader is that this table answers two questions at once: what should I practise next, and is it worth practising in the language I am learning.

Topic notes come from a WeChat column and are mirrored here

The knowledge part of the repository is linked from the README to a WeChat public account, and each topic has both a WeChat article link and a GitHub link.

The array knowledge summary points to Array/array.md in this repository, and the linked list summary points to Linklist/linklist.md, with the WeChat versions alongside each. The README also links the opening article of the column announcing the LeetCode series.

So the arrangement is a two channel publication. The long form explanation lives on the WeChat platform, and the GitHub repository holds the Markdown version of the same notes plus the code, which is what makes the notes diffable, translatable and searchable. A reader who prefers the article format reads the column; a reader who wants to search the notes and run the code stays in the repository.

That dual structure is also why the top level only has four topic folders in the tree listing rather than a dozen. The excerpt shows the arrays and linked list notes, and the tree confirms that queue and stack folders exist alongside them, so the set of data structures covered is wider than the README excerpt displays.

Where the solutions are kept

The code lives in five directories at the top level, one per language: c++/, java/, python/, shell/ and sql/. The convention is straightforward, and the language column in the tables points into it.

The shell/ and sql/ directories are the ones worth a second look, because they suggest the author is not treating every LeetCode problem as an algorithms exercise. A problem whose difficulty is listed as easy in a table and whose natural answer is a SQL statement does not need a Python program, and putting the query where the language column says SQL is a more honest answer than writing a wrapper.

The tests/ directory alongside them suggests the solutions are checked rather than merely transcribed. The README excerpt does not describe a test runner or a command for running them, so how the tests are executed is not documented here, and that is worth noting for anyone who wants to verify a solution rather than read it.

The practical shape is that this repository answers the question that LeetCode itself is bad at answering. On the site, a problem is a page. Here, a problem is an entry in a family, and the family is the unit of study.

A problem-numbered index has a natural ceiling

The scope is stated in the description itself, LeetCode 1 to 400, and the release list is empty, with the repository having no GitHub releases. The last push was on 2026-07-09.

That boundary is the main limitation, and it is structural rather than a matter of effort. A range of problem numbers is a snapshot of the platform as it was, and LeetCode adds problems continuously, so the newest material, and often the material that reflects current interview patterns, is simply not in the index. There is no changelog and no release cadence to tell you what was added when.

The second limitation is the resolution of the notes. The repository calls itself a summary, and a summary of a technique is a map rather than a derivation. Someone who wants to understand why a sliding window works will find the family and the problems, and will still need a textbook or a course for the proof.

The third is language. The notes are written in Chinese, so an English speaking reader gets the taxonomy, the problem links and the code, but not the explanations, and the WeChat articles are the fuller treatment.

The alternative to weigh is the platform's own material plus a textbook. LeetCode's editorials and discussions are per problem and written by many authors, so they are deep on any single question and silent on how problems relate. This repository is the opposite: thin on any single problem and explicit about the relationship, with runnable code in five languages. Learning one problem from the platform and one idea from this repository is a reasonable division of labour.

Editorial conclusion

leetcodebook suits a Chinese speaking learner who wants the problems arranged by idea rather than by number, and who wants runnable solutions in more than one language. It does not suit someone who needs coverage of problems beyond the 1 to 400 range, and it does not replace a textbook, because the notes are summaries rather than derivations. Verify first that the problem you are looking for is in the tables and that a solution exists in the language column, and check the licence situation yourself, since the repository records no licence and lists no licence file.

Frequently asked questions

What does the leetcodebook repository contain?

A summary of LeetCode problems 1 to 400, topic knowledge and problem type summaries, and tables mapping each topic to the corresponding problems. The notes are organised by data structure in the Array/, Linklist/, Queue/ and Stack/ folders, and the solutions live in the c++/, java/, python/, shell/ and sql/ directories.

How do I find a specific problem in leetcodebook?

Through the category tables, each of which lists the problem number, a link to the problem on leetcode.com, the difficulty and the languages in which a solution is available. The categories in the README include the K-SUM family, interval problems, subarray problems, rotate problems and array sorting.

Which languages have solutions in leetcodebook?

The tables list python, java and c++ for the problems shown, and the repository tree contains c++/, java/, python/, shell/ and sql/ directories, so some problems are answered with a shell command or a SQL query.

In what language is the leetcodebook material written?

The README and the topic notes are in Chinese, and the knowledge articles are published on a WeChat public account with Markdown versions mirrored in the repository, for example Array/array.md and Linklist/linklist.md.

What licence applies to the leetcodebook repository?

The repository records no licence and lists no licence file among its top level entries, so the licensing position has to be checked with the author before the code or notes are reused.

Official sources

  1. huxiaoman7/leetcodebook on GitHub
  2. Issues
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/huxiaoman7-leetcodebook.svg)](https://hysenlabs.com/projects/huxiaoman7-leetcodebook)

Was this useful?