Repository navigation
Releases
v0.7.1
This patch improves judging for 26 existing problems. All 249 problems remain available in seven languages. Requires hc v0.1.0-alpha.17 or newer (pack protocol 1).
- Design Twitter now uses the active follow set in its C reference. Five language references for Kth Largest Element in an Array now count values, and five for Kth Smallest Element in a Sorted Matrix now binary-search the value range.
- The pack adds 56 generated cases and retires eight, preserving every stored case and example. New inputs cover reverse-ordered intervals, dense course prerequisites and strings with long repeated blocks.
- The full seven-language check passed locally and in PR CI. Some slower algorithms still pass depending on the language and machine, including the C flatten-and-sort solution for Sorted Matrix near its 50 ms budget. See the validation results in #95.
What's Changed
Fixes
- fix: calibrate multilingual references and worst-case inputs for 26 problems by @MorePeanuts in #95
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Language support
All 249 existing problems now include native templates and reference solutions for C, C++, Java, JavaScript and TypeScript, alongside Go and Python. Required native C bindings are included.
This release extends the existing problem set; it adds no new problems and preserves the existing statements, cases, generators, checkers, problem identities and groups. The pack protocol remains version 1.
Requirements
Requires handcoding v0.1.0-alpha.17 or newer. Supported toolchains are Go 1.22+, Python 3.12+, C11, C++17, Java 17+, Node.js 22+ and TypeScript 5.7+. CI and the bundled authoring skills are updated to hc v0.1.0-alpha.17.
Validation and known limitation
The complete seven-language pack check passed locally and in CI: 249 problems and 1,743 reference solutions. The release commit only updates the pack version.
Some deliberately slower solutions can still pass depending on the language and timing conditions. Reproductions and coverage details are tracked in handcoding #205.
What's Changed
Other changes
- chore: bump hc to v0.1.0-alpha.17 by @MorePeanuts in #91
- feat: add C, C++, Java, JavaScript and TypeScript support to all 249 problems by @MorePeanuts in #93
Full Changelog: v0.6.2...v0.7.0
v0.6.2
Added
Complete coverage of the current LeetCode CN Hot 100 study plan: 100/100 problems, with 249 problems in the pack overall.
- 0031 — Next Permutation
- 0034 — Find First and Last Position of Element in Sorted Array
- 0114 — Flatten Binary Tree to Linked List
- 0148 — Sort List
- 0160 — Intersection of Two Linked Lists
- 0189 — Rotate Array
- 0236 — Lowest Common Ancestor of a Binary Tree
- 0283 — Move Zeroes
- 0438 — Find All Anagrams in a String
All nine include official English and Chinese statements, Go and Python reference solutions, topic grouping, and 306 total cases (including deterministic inputs near constraint limits).
Validation and compatibility
- Whole-pack checks pass with CI-pinned hc v0.1.0-alpha.13.
- Two incorrect implementations per new problem were rejected; generated inputs were checked against the statement constraints.
- No problems removed, signatures changed, or breaking changes introduced. Pack protocol remains 1.
- Minimum hc version remains v0.1.0-alpha.11, with Python 3.12+; Go references support Go 1.22+.
- Special node-reference encodings for 160 and 236 are documented in the English hc notes; Chinese statements remain as fetched from LeetCode.
Version v0.6.2 is published at the maintainer's explicit request for this addition batch.
What's Changed
New problems
- feat: complete LeetCode Hot 100 coverage by @MorePeanuts in #89
Full Changelog: v0.6.1...v0.6.2
v0.6.1
新增题目
新增 5 道题,题包由 235 道增至 240 道:
- 145 二叉树的后序遍历
- 589 N 叉树的前序遍历
- 590 N 叉树的后序遍历
- 429 N 叉树的层序遍历
- 797 所有可能的路径
实现与详细验证记录:PR #87。
前四题归入 trees,797 归入 graphs。每题均包含力扣官方中英文题面、本地图片、Go/Python 模板及参考解。按照维护者指定,本批次发布为 v0.6.1。
判题与验证
- 每题 32 个用例,共 160 个:12 个官方示例、133 个补充存储用例、15 个生成用例。
- 覆盖空树、重复值、兄弟节点顺序、100 节点二叉树、1000 层 N 叉树、10000 节点宽树,以及任意编号 DAG、共享后缀、无路径和包含 8192 条路径的稠密 DAG。
- 四道遍历题严格比较顺序;797 仅忽略路径列表的外层顺序,每条路径内部仍按节点顺序比较。Go 参考解以相反顺序枚举路径,验证不同合法输出均能通过。
- 15 个常见错误解变体均被拒绝,全部展开输入通过独立约束检查,Go/Python 参考解全部通过。
- 每题提交前使用 CI 固定的 hc v0.1.0-alpha.13 运行完整
hc pack check;最终 240 题全部通过,PR 和发布提交的 GitHub CI 均通过。 - hc 不静态强制 145/589/590 的迭代写法 follow-up,也不宣称严格区分所有较慢但正确的算法。树遍历参考解为 O(n),797 按题意枚举路径。
兼容性
Protocol 保持 1;最低可读取版本延续 hc v0.1.0-alpha.11,建议使用本次本地验证及 CI 使用的 v0.1.0-alpha.13 或更新版本。参考解兼容 Python 3.12 / Go 1.22。
没有删除、重命名或现有签名变更,无破坏性变更,无需迁移已有解答。
完整变更:v0.6.0...v0.6.1
v0.6.0
新增题目
按 26 个题单补充 issue 新增 80 道题,题包由 155 道增至 235 道。由 9 个 subagent 分担实现,主 agent 统一验收,合入 PR #85。
题目保持官方英文与中文题面,提供 Python / Go 参考实现、示例、边界与大规模生成用例。前缀和及差分数组归入 arrays-hashing,单调栈归入 stack;按主要题型分组,仅在明显属于多个主题时交叉收录。
hc 调用与输出说明
中文题面保持官方原文。以下本地协议表示与 LeetCode 页面展示不同:
- 24:hc 比较交换后链表的值序列,不检查提交是否修改节点值;两份参考实现实际交换节点,并已独立核验节点身份与值保持不变。
- 88:hc 比较调用结束后的
nums1,忽略函数返回值。 - 117:返回值按
next指针读取为逐层数组,如[[1],[2,3],[4,5,7]],不用#分隔;判题不强制常数辅助空间。 - 75:hc 比较原地修改后的数组;不静态检查库排序调用或辅助空间使用,两份参考实现均为线性时间、常数辅助空间。
- 80:返回长度
k用于截取原地修改后的nums,hc 的期望输出是前k项,尾部不参与判定;额外空间使用不静态强制。 - 341:用构造器和
hasNext/next操作序列调用;每步产生一个输出,构造器为null,hasNext为布尔值。 - 1514:正文使用
start/end,当前官方模板及 hc 输入字段为start_node/end_node;按题意采用1e-5误差容限。 - 随机题检查输出合法性和抽样分布,不要求复现示例中的某一次随机结果。统计判定的每个用例误拒概率上界为 1e-9。
- 382 的常数空间 follow-up 不由判题器强制;398 的索引表与扫描式蓄水池解法均已验证可以通过。
- 622 的参考实现自行维护环形缓冲区;hc 不静态检查是否使用了语言内置队列,也不保证在合法规模下区分 O(1) 与移位数组出队。
- 450 的 O(h) follow-up 不作可靠计时区分;两种语言的参考实现均满足 O(h)。
额外空间、库函数禁用等源码层面的要求不由 hc 静态检查;参考实现遵守相应要求。时间测试使用官方输入规模:35、162 的线性解,以及 75、88、240、658、700、701、450、241 的部分较慢正确解仍可能通过,因此不宣称严格强制这些题的渐近复杂度。
41 的常数空间要求、169 的常数空间 follow-up 和 172 的对数时间 follow-up 同样不作静态强制。990 的 Floyd 解、1094 的逐位置累加解在官方规模下实测可通过。
兼容性与验证
- Protocol 保持
1;最低可读取版本延续 hcv0.1.0-alpha.11,本次验证及 CI 使用v0.1.0-alpha.13,建议使用该版本。Python 3.12 / Go 1.22 兼容性由 hc 验证。 - 无删除题目、重命名或签名变更,无破坏性变更,无需迁移已有解答。
- 新增 2,539 个用例,其中 184 个官方示例和 262 个大规模生成用例;全部示例输入与题面逐一核对。
- 主 agent 逐题审阅参考解、生成器及自定义判题器,独立验证答案与约束,检查错误解拒绝和正确替代解接受的证据。
hc pack check:235 题全部通过;合并 PR 和发布提交的 GitHub CI 均通过。
新增题目索引
- 链表双指针习题集(2 题):82, 445
- 递归操作链表(2 题):24, 234
- 二维数组(2 题):59, 151
- 数组双指针习题集(5 题):14, 75, 80, 88, 977
- 滑动窗口习题集(4 题):219, 713, 1004, 1658
- 二分搜索习题集(6 题):35, 81, 162, 240, 392, 658
- 前缀和习题集(4 题):523, 525, 724, 1314
- 差分数组(2 题):1094, 1109
- 栈习题集(2 题):71, 394
- 队列习题集(3 题):622, 933, 2073
- 单调栈习题集(2 题):402, 901
- 运用「遍历」思维解题(3 题):129, 257, 437
- 运用「分解问题」思维解题(2 题):101, 106
- 运用层序遍历解题(5 题):103, 117, 662, 863, 958
- 二叉搜索树(6 题):96, 108, 450, 538, 700, 701
- 哈希表习题集(6 题):41, 169, 290, 380, 387, 645
- 数据结构设计习题集(2 题):341, 729
- 图(2 题):785, 990
- Dijkstra 算法习题集(2 题):1514, 1631
- 回溯习题集(2 题):93, 491
- 深度优先搜索(1 题):1254
- BFS 习题集(4 题):310, 841, 1091, 1926
- 动态规划(3 题):32, 64, 279
- 分治算法(1 题):241
- 数学技巧(3 题):118, 172, 204
- 随机算法(4 题):382, 384, 398, 528
Full changelog: v0.5.1...v0.6.0
v0.5.1
Topic groups
- Add
queuewith Sliding Window Maximum (239). - Add
designwith 12 existing data structure design problems. - Add
divide-and-conquerwith Merge k Sorted Lists (23), Construct Binary Tree from Preorder and Inorder Traversal (105), and Sort an Array (912). - Add
randomizedas an empty group for future randomized exercises. - Prefer a problem's primary topic and retain multiple memberships only when it clearly belongs to multiple topics. Prefix sums and difference arrays use
arrays-hashing; monotonic stacks usestack.
Existing group order and memberships are preserved. The pack still contains 155 problems; no problem statements, signatures, references, cases, or judge rules changed in this release.
Authoring and CI
- Upgrade the pinned hc version from
v0.1.0-alpha.11tov0.1.0-alpha.13and refresh the bundled Codex and Claude skills (#82). - Add the topic groups and contributor guidance described above (#84).
Compatibility
- Protocol remains
1; the minimum supported reader remains hcv0.1.0-alpha.11. Authoring skills and CI now use hcv0.1.0-alpha.13. - Go and Python support and the official English and Chinese statements are unchanged.
- No breaking changes or migration steps.
Validation
hc pack check: all 155 problems pass with hcv0.1.0-alpha.13.- The grouping PR and the release commit pass repository CI.
Full changelog: v0.5.0...v0.5.1
v0.5.0
Added
Added 67 problems across nine NeetCode 150 topics. The pack now contains 155 problems, including all 143 non-premium NeetCode 150 problems. The seven LeetCode premium problems remain excluded.
- Backtracking (#37): 78.
subsets, 39.combination-sum, 40.combination-sum-ii, 46.permutations, 90.subsets-ii, 22.generate-parentheses, 79.word-search, 131.palindrome-partitioning, 17.letter-combinations-of-a-phone-number, 51.n-queens. - Graphs (#38): 695.
max-area-of-island, 133.clone-graph, 994.rotting-oranges, 417.pacific-atlantic-water-flow, 130.surrounded-regions, 210.course-schedule-ii, 684.redundant-connection, 127.word-ladder. - Advanced Graphs (#39): 743.
network-delay-time, 332.reconstruct-itinerary, 1584.min-cost-to-connect-all-points, 778.swim-in-rising-water, 787.cheapest-flights-within-k-stops. - 1-D Dynamic Programming (#40): 70.
climbing-stairs, 746.min-cost-climbing-stairs, 198.house-robber, 213.house-robber-ii, 647.palindromic-substrings, 91.decode-ways, 152.maximum-product-subarray, 139.word-break, 416.partition-equal-subset-sum. - 2-D Dynamic Programming (#41): 62.
unique-paths, 309.best-time-to-buy-and-sell-stock-with-cooldown, 518.coin-change-ii, 494.target-sum, 97.interleaving-string, 329.longest-increasing-path-in-a-matrix, 115.distinct-subsequences, 312.burst-balloons, 10.regular-expression-matching. - Greedy (#42): 53.
maximum-subarray, 55.jump-game, 45.jump-game-ii, 134.gas-station, 846.hand-of-straights, 1899.merge-triplets-to-form-target-triplet, 763.partition-labels, 678.valid-parenthesis-string. - Intervals (#43): 57.
insert-interval, 435.non-overlapping-intervals, 1851.minimum-interval-to-include-each-query. - Math & Geometry (#44): 48.
rotate-image, 54.spiral-matrix, 73.set-matrix-zeroes, 202.happy-number, 66.plus-one, 50.powx-n, 43.multiply-strings, 2013.detect-squares. - Bit Manipulation (#45): 136.
single-number, 191.number-of-1-bits, 338.counting-bits, 190.reverse-bits, 268.missing-number, 371.sum-of-two-integers, 7.reverse-integer.
The 67 additions contain 2,197 test cases. Each new problem includes official English and Chinese statements, Go and Python references, authored boundary cases, and applicable topic-group membership. Larger cases use deterministic generators; multiple-answer problems use appropriate comparison rules or checkers.
Validation
- Every problem addition passed
hc pack checkbefore its commit. - Reference solutions were tested against independent small-case oracles where appropriate, and cases were checked against plausible incorrect solutions.
- Final integrated pack and release commit passed the repository CI checks.
Compatibility
- Protocol remains
1; minimum supported hc isv0.1.0-alpha.11, the version pinned and verified by CI. - Reference solutions remain compatible with Python 3.12 and Go 1.22.
- No existing problems removed, identities or signatures changed, or breaking changes introduced.
v0.4.3
Adds five LeetCode problems, bringing the pack to 88 problems:
- 0094 Binary Tree Inorder Traversal
- 0111 Minimum Depth of Binary Tree
- 0144 Binary Tree Preorder Traversal
- 0373 Find K Pairs with Smallest Sums
- 0378 Kth Smallest Element in a Sorted Matrix
All five include official English and Chinese statements, Go/Python templates and references, and topic-group entries. The new problems contain 164 cases: 14 statement examples, 132 small regressions, and 18 generated cases. Problem 373 accepts all valid optimal pair selections, including ties and repeated values.
Validation: hc pack check passes all 88 problems with CI-pinned hc v0.1.0-alpha.11. Independent oracle checks and 11 incorrect-implementation mutation checks passed. The brute-force Cartesian-product solution for 373 exceeds the time limit; standard heap and binary-search solutions for 378 pass. Auxiliary-space usage and the traversal problems' iterative follow-up are not automatically enforced.
Requires hc v0.1.0-alpha.11 or later and Python 3.12 or later. Protocol remains 1. No problems removed and no breaking changes.
What's Changed
New problems
- feat: add tree and heap exercises by @MorePeanuts in #36
Full Changelog: v0.4.2...v0.4.3
v0.4.2
Adds LeetCode 707 Design Linked List, bringing the pack to 83 problems.
- Include official English and Chinese statements, Go and Python templates, and singly/doubly linked-list reference implementations.
- Add 35 cases: 1 statement example, 28 small regressions, and 6 generated histories with 2000 calls each.
- Include the problem in the
linked-listgroup.
Validation: hc pack check passes all 83 problems with CI-pinned hc v0.1.0-alpha.11. All 35 new cases also matched an independent array model, and mutation checks rejected three plausible implementation mistakes.
Requires hc v0.1.0-alpha.11 or later and Python 3.12 or later. Protocol remains 1. No problems removed and no breaking changes.
What's Changed
New problems
- feat: add 0707-design-linked-list by @MorePeanuts in #33
Full Changelog: v0.4.1...v0.4.2
v0.4.1
Patch release for the 82-problem LeetCode pack.
- Add a regression case for 0004 Median of Two Sorted Arrays:
[1,2,3,4,6,7]and[5]produce4.0(#31). - Ignore the root
ty.tomlgenerated by hc for its Python environment.
Validation: hc pack check passes all 82 problems; problem 0004 has 39 passing cases.
Requires hc v0.1.0-alpha.11 or later and Python 3.12 or later. Protocol remains 1. No problems added or removed, and no breaking changes.
What's Changed
Fixes
- fix(0004-median-of-two-sorted-arrays): add uneven-length median case by @MorePeanuts in #31
Full Changelog: v0.4.0...v0.4.1