LeetCode Agent

An AI-powered terminal companion for deliberate LeetCode practice — featuring intelligent spaced repetition, company-targeted problem selection, and real-time tutoring powered by DeepSeek.

Scroll to explore
01

Start Practice

Tell the agent what you want to practice — it picks problems, creates solution files, and manages your review queue.

leetcode_agent — zsh
LeetCode Agent v0.1.0 deepseek-chat · ~/leetcode_agent
当前目标:微软 | 难度:Medium | 模式:按标签(数组)
> 开始刷题
我来帮你抽一道题开始刷题。
⊙ pick_problem
复习题目
#题目难度标签
1Two SumEasyArray, Hash Table
20Valid ParenthesesEasyStack, String
新题推荐
#题目难度标签
215数组中的第K个最大元素Medium
53最大子数组和Medium
33搜索旋转排序数组Medium
已开始:215. Kth Largest Element in an Array (Medium)
📁 divide_and_conquer/215_kth_largest_element_in_an_array.py
215 Kth Largest Element in an Array >
02

AI Tutoring

When you're stuck, just ask — the agent reads your code and walks you through multiple approaches.

leetcode_agent — zsh
215 Kth Largest Element in an Array > 教我,实在是不会
我先看看你当前的代码,然后给你讲解这道题的解题思路。
⊙ read_solution
⊙ count_teach
好的,这道题要求找到数组中第k大的元素。有几种经典解法:
方法一:排序(最简单直接)
class Solution:
    def findKthLargest(self, nums: List[int], k: int) -> int:
        nums.sort()
        return nums[-k]
时间复杂度:O(n log n),空间复杂度:O(1)
方法二:使用堆(优先队列)
import heapq

class Solution:
    def findKthLargest(self, nums: List[int], k: int) -> int:
        return heapq.nlargest(k, nums)[-1]
时间复杂度:O(n log k),推荐面试使用 ✨
215 Kth Largest Element in an Array >

Screenshots

Real terminal output with Rich-formatted tables, colored syntax, and structured AI responses.

Daily plan with review and new problems

Daily plan: review queue + new problem recommendations

AI teaching with code explanations

Natural language search + structured AI explanations

Architecture

CLI prompt_toolkit + Rich
AI Agent DeepSeek + Function Calling
LeetCode GraphQL API
Storage SQLite + Spaced Repetition Scheduler
Python 3.11+ DeepSeek V4 SQLite Rich prompt_toolkit LeetCode GraphQL CodeTop API OpenAI SDK