MCPcopy Index your code
hub / github.com/neetcode-gh/leetcode

github.com/neetcode-gh/leetcode @main

repository ↗ · DeepWiki ↗ · Ask this repo → · + Follow
4,550 symbols 7,855 edges 1,800 files 185 documented · 4% updated 3d ago★ 6,4051,344 open issues
README

Leetcode solutions for 🚀 NeetCode.io

This repo hosts the solutions found on NeetCode.io including the solutions shown on the NeetCode YouTube channel. The site will periodically be updated with new solutions from this repo!

Solutions from these languages will be linked from NeetCode.io:

Python, Java, JavaScript, C++, Go, Swift, C#, TypeScript, Rust, Kotlin, Ruby, C, Scala and Dart

Solutions are also welcome for any other supported language on leetcode.com!

Contributing

Please read the contributing guidlines before opening a PR

To contribute, please fork this repo and open a PR adding a missing solution from the supported languages.

If you would like to have collaborator permissions on the repo to merge your own PRs or review others' PRs please let me know.

Credits

Missing Solutions


Need to update the README? Update the template instead.

Extension points exported contracts — how you extend this code

Obj (Interface)
(no doc)
typescript/0261-graph-valid-tree.ts
Visited (Interface)
(no doc)
typescript/0261-graph-valid-tree.ts

Core symbols most depended-on inside this repo

add
called by 324
java/0705-design-hashset.java
get
called by 266
java/0460-lfu-cache.java
push
called by 239
javascript/0155-min-stack.js
size
called by 180
typescript/1046-last-stone-weight.ts
dfs
called by 162
typescript/0078-subsets.ts
isEmpty
called by 154
javascript/0901-online-stock-span.js
put
called by 145
java/0460-lfu-cache.java
push
called by 130
typescript/0155-min-stack.ts

Shape

Method 1,783
Function 1,633
Class 1,086
Struct 38
TypeAlias 8
Interface 2

Languages

TypeScript36%
Java30%
Python23%
Go11%

Modules by API surface

javascript/1268-search-suggestions-system.js17 symbols
javascript/0200-number-of-islands.js17 symbols
javascript/0212-word-search-ii.js15 symbols
javascript/0054-spiral-matrix.js15 symbols
javascript/0323-number-of-connected-components-in-an-undirected-graph.js13 symbols
go/0355-design-twitter.go13 symbols
typescript/1046-last-stone-weight.ts12 symbols
typescript/1046-Last-Stone-Weight.ts12 symbols
javascript/0684-redundant-connection.js12 symbols
javascript/0460-lfu-cache.js12 symbols
javascript/0287-find-the-duplicate-number.js12 symbols
typescript/0307-range-sum-query-mutable.ts11 symbols

Dependencies from manifests, versioned

prettier3.6.2 · 1×

For agents

$ claude mcp add leetcode \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact