explaingit

krahets/leetcode-book

8,289JavaAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A Chinese-language collection of algorithm and data structure solutions in Python, Java, and C++ for three popular interview problem sets, with a structured learning path for programming interview preparation.

Mindmap

mindmap
  root((leetcode-book))
    What it does
      Interview prep solutions
      Three problem sets
      Learning path guidance
    Tech Stack
      Python
      Java
      C++
    Topics Covered
      Algorithms
      Data Structures
      Dynamic Programming
    Audience
      Job seekers
      CS students
      Interview preppers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study worked solutions to classic Sword for Offer interview problems in your choice of Python, Java, or C++.

USE CASE 2

Follow a structured four-step LeetCode study plan progressing from the curated 88-question set up to the Top 100.

USE CASE 3

Read problem analysis notes alongside solution code to understand reasoning, not just memorize answers.

USE CASE 4

Prepare for technical programming interviews at Chinese tech companies using a proven learning path.

Tech stack

PythonJavaC++

Getting it running

Difficulty · easy Time to first run · 5min

Chinese-language README, the code files are readable without any installation.

CC BY-NC-SA 4.0, share and adapt freely for non-commercial purposes only, with attribution and the same license applied to derivatives.

In plain English

LeetCode-Book is a Chinese-language collection of algorithm and data structure solutions aimed at programming interview preparation. It provides worked solutions in Python, Java, and C++ for three separate problem sets: the classic Sword for Offer interview question book (a widely used reference in China), a curated selection of 88 high-frequency interview problems assembled by the repository author, and the problems from the Illustration of Algorithms and Data Structures LeetBook published on LeetCode-CN. The repository is organized into three folders: sword_for_offer for the Sword for Offer problems, selected_coding_interview for the 88-question curated set, and leetbook_ioa for the illustrated algorithm book. All three contain problem analysis notes alongside the solution code. The README is written in Chinese and recommends a learning path. The author suggests reading the Hello Algo book first (a separate beginner-friendly animated introduction to data structures and algorithms, also by this author and available as a separate GitHub project) before working through interview problems. It then points to four LeetCode study plans to follow in order, including the curated 88-question set, the top 100 liked problems, the classic interview 150, and a 75-question core set. For beginners, the README offers advice: solve two to three problems per day, prioritize genuine understanding over volume, follow the list order, and expect to revisit the same material several times before it fully settles. The repository is licensed under CC BY-NC-SA 4.0, which allows sharing and adapting the content for non-commercial purposes with attribution. At the time of the badges shown in the README, 75 of the included solutions had been accepted by the LeetCode judge.

Copy-paste prompts

Prompt 1
I'm preparing for a software engineering interview. Give me a Python solution to the LeetCode Reverse Linked List problem with a step-by-step explanation of the approach.
Prompt 2
Explain the difference between BFS and DFS with a Java implementation I can use in a coding interview setting.
Prompt 3
Write a C++ dynamic programming solution for the 0/1 Knapsack problem and explain the state transition table.
Prompt 4
I'm following the krahets interview prep order. Which data structures should I master first, and what LeetCode problem categories map to each?
Prompt 5
Give me three medium-difficulty tree problems from the Sword for Offer set and walk me through the optimal solution for each.
Open on GitHub → Explain another repo

← krahets on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.