Convert Figma logo to code with AI

MisterBooo logoLeetCodeAnimation

Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路,完整单步/回看/变速/语音讲解在 algomooc.com)

76,618
13,904
76,618
21

Top Related Projects

18,070

LeetCode Problems' Solutions

✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% | LeetCode 题解

Crack LeetCode, not only how, but also why.

Everything you need to know to get the job.

Curated coding interview preparation materials for busy software engineers

Quick Overview

LeetCodeAnimation is a GitHub repository that provides animated explanations for LeetCode algorithm problems. It aims to help users better understand complex algorithms and data structures through visual representations and step-by-step animations.

Pros

  • Visual learning aids make complex algorithms easier to understand
  • Covers a wide range of LeetCode problems and algorithm types
  • Animations are accompanied by detailed explanations in Chinese
  • Open-source project with potential for community contributions

Cons

  • Explanations are primarily in Chinese, limiting accessibility for non-Chinese speakers
  • Not all LeetCode problems are covered
  • Animations may not be updated as frequently as new LeetCode problems are added
  • Some users may prefer text-based explanations over animations

Code Examples

This project is not a code library, but rather a collection of animated explanations for algorithm problems. Therefore, there are no code examples to provide.

Getting Started

As this is not a code library, there are no specific getting started instructions. However, users can access the animated explanations by visiting the GitHub repository and browsing through the available problem solutions. The animations are typically provided as GIF files or links to external animation platforms.

To use the repository:

  1. Visit the GitHub repository: https://github.com/MisterBooo/LeetCodeAnimation
  2. Browse through the available problem solutions in the repository
  3. Click on the desired problem to view the animated explanation and accompanying text
  4. Use the animations and explanations to enhance your understanding of the algorithm or data structure

Competitor Comparisons

18,070

LeetCode Problems' Solutions

Pros of leetcode

  • Comprehensive collection of LeetCode solutions in multiple programming languages
  • Detailed explanations and comments for each solution
  • Regularly updated with new problems and solutions

Cons of leetcode

  • Lacks visual representations or animations to explain algorithms
  • May be overwhelming for beginners due to the large number of solutions
  • Text-based explanations might be less engaging for some learners

Code Comparison

LeetCodeAnimation (Python):

def twoSum(nums, target):
    hash_table = {}
    for i, num in enumerate(nums):
        if target - num in hash_table:
            return [hash_table[target - num], i]
        hash_table[num] = i
    return []

leetcode (C++):

vector<int> twoSum(vector<int>& nums, int target) {
    unordered_map<int, int> map;
    for (int i = 0; i < nums.size(); i++) {
        if (map.find(target - nums[i]) != map.end())
            return {map[target - nums[i]], i};
        map[nums[i]] = i;
    }
    return {};
}

Both repositories offer valuable resources for LeetCode problem-solving. LeetCodeAnimation focuses on visual explanations and animations, making it more accessible for visual learners. leetcode provides a wider range of solutions in multiple languages with detailed explanations, catering to a broader audience of programmers. The choice between the two depends on individual learning preferences and programming language requirements.

✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% | LeetCode 题解

Pros of LeetCode-Go

  • Comprehensive coverage of LeetCode problems in Go
  • Well-organized structure with detailed explanations and complexity analysis
  • Regular updates and active maintenance

Cons of LeetCode-Go

  • Lacks visual representations or animations for problem-solving steps
  • May be less engaging for visual learners compared to LeetCodeAnimation
  • Focused solely on Go, limiting its audience to Go developers

Code Comparison

LeetCode-Go (Go):

func twoSum(nums []int, target int) []int {
    m := make(map[int]int)
    for i, num := range nums {
        if j, ok := m[target-num]; ok {
            return []int{j, i}
        }
        m[num] = i
    }
    return nil
}

LeetCodeAnimation (Java):

public int[] twoSum(int[] nums, int target) {
    Map<Integer, Integer> map = new HashMap<>();
    for (int i = 0; i < nums.length; i++) {
        int complement = target - nums[i];
        if (map.containsKey(complement)) {
            return new int[] { map.get(complement), i };
        }
        map.put(nums[i], i);
    }
    throw new IllegalArgumentException("No two sum solution");
}

Both repositories offer valuable resources for LeetCode problem-solving, with LeetCode-Go providing in-depth Go implementations and LeetCodeAnimation offering visual explanations. The choice between them depends on the user's preferred learning style and programming language focus.

Crack LeetCode, not only how, but also why.

Pros of fucking-algorithm

  • More comprehensive coverage of algorithms and data structures
  • In-depth explanations with detailed problem-solving strategies
  • Regular updates and active community engagement

Cons of fucking-algorithm

  • Primarily text-based explanations, lacking visual aids
  • May be overwhelming for beginners due to its depth and complexity

Code Comparison

LeetCodeAnimation:

public ListNode reverseList(ListNode head) {
    ListNode prev = null;
    ListNode curr = head;
    while (curr != null) {
        ListNode nextTemp = curr.next;
        curr.next = prev;
        prev = curr;
        curr = nextTemp;
    }
    return prev;
}

fucking-algorithm:

ListNode* reverseList(ListNode* head) {
    if (head == nullptr || head->next == nullptr) {
        return head;
    }
    ListNode* last = reverseList(head->next);
    head->next->next = head;
    head->next = nullptr;
    return last;
}

Summary

LeetCodeAnimation focuses on visual representations of algorithms, making it easier for beginners to grasp concepts. It uses animations to illustrate problem-solving processes, which can be particularly helpful for visual learners.

fucking-algorithm, on the other hand, provides more in-depth explanations and covers a wider range of topics. It offers detailed problem-solving strategies and regular updates, making it suitable for those seeking a deeper understanding of algorithms and data structures.

While LeetCodeAnimation excels in visual presentation, fucking-algorithm offers more comprehensive textual explanations and a broader scope of content. The choice between the two depends on individual learning preferences and the desired depth of understanding.

Everything you need to know to get the job.

Pros of interviews

  • Covers a broader range of topics beyond just LeetCode problems, including system design and behavioral questions
  • Provides more comprehensive explanations and solutions in text format
  • Includes resources and links to additional learning materials

Cons of interviews

  • Lacks visual representations or animations to illustrate concepts
  • May be overwhelming for beginners due to the extensive amount of information
  • Less frequently updated compared to LeetCodeAnimation

Code Comparison

LeetCodeAnimation (Java):

public ListNode reverseList(ListNode head) {
    ListNode prev = null;
    ListNode curr = head;
    while (curr != null) {
        ListNode nextTemp = curr.next;
        curr.next = prev;
        prev = curr;
        curr = nextTemp;
    }
    return prev;
}

interviews (Python):

def reverse_list(head):
    prev = None
    current = head
    while current:
        next_node = current.next
        current.next = prev
        prev = current
        current = next_node
    return prev

Both repositories provide similar implementations for reversing a linked list, with LeetCodeAnimation using Java and interviews using Python. The core logic remains the same, demonstrating the consistency in problem-solving approaches across different programming languages.

Curated coding interview preparation materials for busy software engineers

Pros of tech-interview-handbook

  • Comprehensive coverage of various interview topics beyond just coding problems
  • Includes non-technical aspects of interviews, such as behavioral questions and negotiation tips
  • Regularly updated with community contributions and industry trends

Cons of tech-interview-handbook

  • Lacks visual aids or animations to explain complex concepts
  • May be overwhelming for beginners due to the breadth of information covered
  • Doesn't focus specifically on step-by-step problem-solving techniques

Code Comparison

While both repositories primarily focus on interview preparation, they don't typically include extensive code samples. However, tech-interview-handbook does provide some code snippets for common algorithms and data structures. Here's an example of a binary search implementation from tech-interview-handbook:

def binary_search(arr, target):
    left, right = 0, len(arr) - 1
    while left <= right:
        mid = (left + right) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid - 1
    return -1

LeetCodeAnimation, on the other hand, focuses more on visual representations and animations rather than code snippets.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

LeetCodeAnimation

用动画把 LeetCode 题解过程拆开看:指针怎么移动、状态怎么转移、递归怎么展开、边界为什么成立。 GitHub 这份是公开索引与历史素材;完整的单步、回看、变速、语音讲解在网站版。

GitHub stars last commit LeetCode 动画题数

🎬 在线交互版 📚 按专题刷 🤖 AI 私教小欧

如果这个项目帮到你,欢迎 Star 支持持续更新。


🚧 2026 大版本进行中

这个仓库不是一次性归档。2026 年正在做一轮大版本升级,只列已上线 / 进行中的实话:

  • ✅ 三语言参考代码:每道题的题解配 Python / C++ / Java 三种实现,Python 为默认。
  • ✅ AI 私教「小欧」:吴师兄带的 AI 算法私教,做题卡住可随时追问思路与边界。
  • ✅ **吴师兄声线语音讲解**:动画边演示边讲,语音为 AI 合成(吴师兄声线授权);点播放器里的 🔊 即可听。
  • 🚧 299 题全量质量清算:对全站动画题逐题做质量复核与重制,分批上线,持续同步回本仓库索引。

进度会随同步脚本更新到下方「当前索引」与 docs/sync-log.md。


网站版动画预览

下面四张 GIF 取自网站播放器的关键帧,点图直达对应题目页(完整步骤播放、三语言代码、语音讲解都在网站版)。

两数之和动画预览
两数之和
边扫数组边维护哈希表,看清 complement 是怎么被找到的。
接雨水动画预览
接雨水
用柱状图把左右边界和蓄水过程拆开,直观看懂为什么能接住水。
岛屿数量动画预览
岛屿数量
DFS 染色过程一格一格展开,连通块边界会更容易看清。
环形链表动画预览
环形链表
快慢指针在链表上同步移动,什么时候相遇一眼能看到。

↑ 网站版还能单步、回看、变速、听讲解 —— 打开在线交互版 →


项目特点

  • **动画题解**:先看清算法过程,再回到代码。很多题目保留了 GIF 或分步动画素材。
  • 三语言代码:题解配 Python / C++ / Java 三种参考实现。
  • **结构化数据**:docs/data/manifest.json 可被脚本读取,用于生成索引、检查链接或二次整理。
  • **持续同步**:网站侧新增或调整动画后,通过脚本同步回 GitHub —— 仓库不是静态归档。

当前索引

下表数字由 tools/scripts/build-readme.js 据 docs/data/manifest.json 实算注入,请勿手改。

项目数量 / 位置
LeetCode 动画题数256
简单71
中等160
困难25
数据文件docs/data/manifest.json
按题号索引docs/leetcode-animation-index.md
按专题索引docs/index-by-topic.md
网站路径https://www.algomooc.com/leetcode-animation

数字口径:上表 256 指**已同步到本仓库的 LeetCode 题动画数**(脚本据网站侧 study_index.js → manifest.json 实算)。 近况区提到的 299 指 algomooc.com 全站动画内容总数(含进阶题与专题,口径来自站内 content-stats 单一数据源),范围比本仓库已同步的 LeetCode 子集更大。 两个数字都由脚本接管、禁止手写:256 来自本仓库 manifest,299 随站内 content-stats 同步回填(见 docs/data/stats.json 的 siteTotal 字段)。


内容地图

想找什么从这里开始
按题号查动画docs/leetcode-animation-index.md
按专题查动画docs/index-by-topic.md
用脚本处理题目数据docs/data/manifest.json
查看早期题解文章docs/notes/ 或 problems/ 下各题的 Article/
查看早期动画素材problems/ 下各题的 Animation/
查看同步记录docs/sync-log.md

🛠 维护者:同步与数据说明(点击展开 —— 普通读者可略过)

仓库和网站的关系

GitHub 仓库保存历史内容、公开索引和同步脚本;网站侧维护当前动画页面。交互播放、步骤切换、阅读体验以网站版本为准。同步脚本把网站题目列表写回仓库,方便在 GitHub 上审阅、检索和版本化。

同步方式

网站侧题目索引来自 study_index.js。同步前先审查:

npm run review:site

确认需要同步后运行:

npm run sync        # 更新 manifest / 题号索引 / 专题索引 / 同步记录
npm run validate    # 校验 manifest
node tools/scripts/build-readme.js --write   # 把 README 数字段 + stats.json 重新注入

会更新:

  • docs/data/manifest.json
  • docs/leetcode-animation-index.md
  • docs/index-by-topic.md
  • docs/sync-log.md
  • docs/data/stats.json 与 README 的 当前索引 标记区(数字段)

更完整的判断规则、commit 规范和数字接管机制见 docs/sync-workflow.md 与 docs/HOW-TO-INTERACT.md。

目录

路径说明
docs/data/manifest.jsonLeetCode 动画索引数据(数字单一数据源)
docs/data/stats.json由脚本实算的计数,供 README 徽章读取
docs/leetcode-animation-index.md由 manifest 生成的题目列表
docs/index-by-topic.md由 manifest 生成的专题索引
docs/sync-log.md网站侧索引同步记录
docs/sync-workflow.md网站和 GitHub 联动流程
tools/scripts/review-site-changes.js判断网站侧改动是否需要同步
tools/scripts/sync-algomooc-index.js从网站侧 study_index.js 同步索引
tools/scripts/validate-manifest.js校验 manifest
tools/scripts/build-readme.js注入 README 数字段 + 生成 stats.json
docs/assets/previews/README 使用的网站版动画预览 GIF
docs/notes/ · problems/早期题解文章、代码与动画素材

⭐ Star 一下,陪它持续更新

Star History Chart

这个项目从一张张手画动画走到今天,靠的是每一个 Star 的鼓励。 如果它让你把某道题真正看懂了,点个 Star 就是对持续更新最实在的支持。

📌 内容持续同步自 algomooc.com —— 网站更新,仓库索引随脚本同步。

English

See docs/README-En.md.