gitwtfhub

wtf is leetcode-book?

krahets/leetcode-book — explained in plain English

Analysis updated 2026-06-24

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

TL;DR

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

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

Why would anyone build with this?

REASON 1

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

REASON 2

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

REASON 3

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

REASON 4

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

What's in the stack?

PythonJavaC++

How it stacks up

krahets/leetcode-bookalibaba/transmittable-thread-localbytedeco/javacv
Stars8,2898,2948,308
LanguageJavaJavaJava
Setup difficultyeasyeasyeasy
Complexity1/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

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.

Wtf does this do

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.

Yoink these 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.

Frequently asked questions

wtf is leetcode-book?

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.

What language is leetcode-book written in?

Mainly Java. The stack also includes Python, Java, C++.

What license does leetcode-book use?

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

How hard is leetcode-book to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is leetcode-book for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.