Skip to content

zhoujun-web/leetcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode


Template



TwoPointer

Title cn Difficulty Solution Algorithm
0003.longest-substring-without-repeating-characters 无重复字符的最长子串 Medium Go
0019.remove-nth-node-from-end-of-list 删除链表的倒数第 N 个结点 Medium Go
0027.remove-element 移除元素 Easy Go
0030.substring-with-concatenation-of-all-words 串联所有单词的子串 Hard Go
0042.trapping-rain-water 接雨水 Hard Go
0075.sort-colors 颜色分类 Medium Go
0076.minimum-window-substring 最小覆盖子串 Hard Go
0080.remove-duplicates-from-sorted-array-ii 删除有序数组中的重复项 II Medium Go
0424.longest-repeating-character-replacement 替换后的最长重复字符 Medium Go
0443.string-compression 压缩字符串 Medium Go
0524.longest-word-in-dictionary-through-deleting 通过删除字母匹配到字典里最长单词 Medium Go
0718.maximum-length-of-repeated-subarray 最长重复子数组 Medium Go
0930.binary-subarrays-with-sum 和相同的二元子数组 Medium Go
1099.two-sum-less-than-k 小于 K 的两数之和 Easy Go
1790.check-if-one-string-swap-can-make-strings-equal 仅执行一次字符串交换能否使两个字符串相等 Easy Go

Bit

Title cn Difficulty Solution Algorithm
0067.add-binary 二进制求和 Easy Go
0136.single-number 只出现一次的数字 Easy Go
0137.single-number-ii 只出现一次的数字 II Medium Go
0260.single-number-iii 只出现一次的数字 III Medium Go
0371.sum-of-two-integers 两整数之和 Medium Go
0401.binary-watch 二进制手表 Easy Go
0421.maximum-xor-of-two-numbers-in-an-array 数组中两个数的最大异或值 Medium Go
0461.hamming-distance 汉明距离 Easy Go
0476.number-complement 数字的补数 Easy Go
0477.total-hamming-distance 汉明距离总和 Medium Go
0869.reordered-power-of-2 重新排序得到 2 的幂 Medium Go
1689.partitioning-into-minimum-number-of-deci-binary-numbers 十-二进制数的最少数目 Medium Go
Offer 0015.er-jin-zhi-zhong-1de-ge-shu-lcof 二进制中1的个数 Medium Go
Trans#0168.excel-sheet-column-title Excel 表列名称 Easy Go

Bfs

Title cn Difficulty Solution Algorithm
0098.validate-binary-search-tree 验证二叉搜索树 Medium Go
0102.binary-tree-level-order-traversal 二叉树的层序遍历 Medium Go
0103.binary-tree-zigzag-level-order-traversal 二叉树的锯齿形层序遍历 Medium Go
0107.binary-tree-level-order-traversal-ii 二叉树的层序遍历 II Medium Go
0111.minimum-depth-of-binary-tree 二叉树的最小深度 Easy Go
0116.populating-next-right-pointers-in-each-node 填充每个节点的下一个右侧节点指针 Medium Go
0117.populating-next-right-pointers-in-each-node-ii 填充每个节点的下一个右侧节点指针 II Medium Go
0199.binary-tree-right-side-view 二叉树的右视图 Medium Go
0297.serialize-and-deserialize-binary-tree 二叉树的序列化与反序列化 Hard Go
0428.serialize-and-deserialize-n-ary-tree 序列化和反序列化 N 叉树 Hard Go
0429.n-ary-tree-level-order-traversal N 叉树的层序遍历 Medium Go
0433.minimum-genetic-mutation 最小基因变化 Medium Go
0513.find-bottom-left-tree-value 找树左下角的值 Medium Go
0515.find-largest-value-in-each-tree-row 在每个树行中找最大值 Medium Go
0559.maximum-depth-of-n-ary-tree N 叉树的最大深度 Easy Go
0623.add-one-row-to-tree 在二叉树中增加一行 Medium Go
0637.average-of-levels-in-binary-tree 二叉树的层平均值 Easy Go
1161.maximum-level-sum-of-a-binary-tree 最大层内元素和 Medium Go
1306.jump-game-iii 跳跃游戏 III Medium Go

Stack

Title cn Difficulty Solution Algorithm
0020.valid-parentheses 有效(){}[]括号 Easy Go
0032.longest-valid-parentheses 最长有效()括号 Hard Go
0071.simplify-path 简化路径 Medium Go
0084.largest-rectangle-in-histogram 统计矩形 Hard Go
0085.maximal-rectangle 最大矩形 Hard Go
0094.binary-tree-inorder-traversal 二叉树的中序遍历 Easy Go
0103.binary-tree-zigzag-level-order-traversal 二叉树的锯齿形层序遍历 Medium Go
0144.binary-tree-preorder-traversal 二叉树的前序遍历 Easy Go
0145.binary-tree-postorder-traversal 二叉树的后序遍历 Easy Go
0150.evaluate-reverse-polish-notation 逆波兰表达式求值 Medium Go
0155.min-stack 最小栈 Easy Go
0224.basic-calculator 加减小括号 Hard Go
0225.implement-stack-using-queues 用队列实现栈 Easy Go
0227.basic-calculator-ii 加减乘除 Medium Go
0232.implement-queue-using-stacks 用栈实现队列 Easy Go
0255.verify-preorder-sequence-in-binary-search-tree 验证前序遍历序列二叉搜索树 Medium Go
0272.closest-binary-search-tree-value-ii 最接近的二叉搜索树值 II Hard Go
0316.remove-duplicate-letters 去除重复字母 Medium Go
0331.verify-preorder-serialization-of-a-binary-tree 验证二叉树的前序序列化 Medium Go
0341.flatten-nested-list-iterator 扁平化嵌套列表迭代器 Medium Go
0385.mini-parser 迷你语法分析器 Medium Go
0394.decode-string 字符串解码 Medium Go
0402.remove-k-digits 移掉K位数字后最小 Medium Go
0430.flatten-a-multilevel-doubly-linked-list 扁平化多级双向链表 Medium Go
0439.ternary-expression-parser 三元表达式解析器 Medium Go
0445.add-two-numbers-ii 两数相加 Medium Go
0456.132-pattern 132 模式 Medium Go
0496.next-greater-element-i 下一个更大元素 I Easy Go
0503.next-greater-element-ii 下一个更大的值 Medium Go
0591.tag-validator 标签验证器 Hard Go
0636.exclusive-time-of-functions 函数的独占时间 Medium Go
0678.valid-parenthesis-string 有效的括号字符串 Medium Go
0726.number-of-atoms 原子的数量 Hard Go
0735.asteroid-collision 星球碰撞 Medium Go
0739.daily-temperatures 能观测到更高温度的天数 Medium Go
0772.basic-calculator-iii 加减乘除小括号 Hard Go
0844.backspace-string-compare 比较含退格的字符串 Easy Go
0856.score-of-parentheses 括号的分数 Medium Go
0880.decoded-string-at-index 索引处的解码字符串 Medium Go
0895.maximum-frequency-stack 最大频率栈 Hard Go
0901.online-stock-span 股票价格跨度 Medium Go
0921.minimum-add-to-make-parentheses-valid 使括号有效的最少添加 Medium Go
0946.validate-stack-sequences 验证栈序列 Medium Go
1003.check-if-word-is-valid-after-substitutions 检查替换后的词是否有效 Medium Go
1019.next-greater-node-in-linked-list 下一个更大的值 Medium Go
1081.smallest-subsequence-of-distinct-characters 去除重复字母 Medium Go
1190.reverse-substrings-between-each-pair-of-parentheses 反转每对括号间的子串 Medium Go
1221.split-a-string-in-balanced-strings 分割平衡字符串 Easy Go
1544.make-the-string-great 整理字符串 Easy Go
1598.crawler-log-folder 文件夹操作日志搜集器 Easy Go

Enum

Title cn Difficulty Solution Algorithm
0002.add-two-numbers 两数相加 Medium Go
0006.zigzag-conversion Z 字形变换 Medium Go
0014.longest-common-prefix 最长公共前缀 Easy Go
0036.valid-sudoku 有效的数独 Medium Go
0038.count-and-say 外观数列 Medium Go
0058.length-of-last-word 最后一个单词的长度 Easy Go
0121.best-time-to-buy-and-sell-stock 买卖股票的最佳时机 Easy Go
0122.best-time-to-buy-and-sell-stock-ii 买卖股票的最佳时机 II Medium Go
0125.valid-palindrome 验证回文串 Easy Go
0171.excel-sheet-column-number Excel 表列序号 Easy Go
0423.reconstruct-original-digits-from-english 从英文中重建数字 Medium Go
1213.intersection-of-three-sorted-arrays 三个有序数组的交集 Easy Go
1295.find-numbers-with-even-number-of-digits 统计位数为偶数的数字 Easy Go
1389.create-target-array-in-the-given-order 按既定顺序创建目标数组 Easy Go
1503.last-moment-before-all-ants-fall-out-of-a-plank 所有蚂蚁掉下来前的最后一刻 Medium Go
1646.get-maximum-in-generated-array 获取生成数组中的最大值 Easy Go
1672.richest-customer-wealth 最富有客户的资产总量 Easy Go
2042.check-if-numbers-are-ascending-in-a-sentence 检查句子中的数字是否递增 Easy Go
5875.final-value-of-variable-after-performing-operations 执行操作后的变量值 Hard Go
Go

Tree

Title cn Difficulty Solution Algorithm
0022.generate-parentheses 有效的 括号组合 Medium Go
0094.binary-tree-inorder-traversal Easy Go
Go
Go
Go
0095.unique-binary-search-trees-ii Medium Go
0096.unique-binary-search-trees Medium Go
Go
0098.validate-binary-search-tree Medium Go
Go
Go
Go
0099.recover-binary-search-tree Medium Go
Go
Go
0100.same-tree Easy Go
0101.symmetric-tree Easy Go
0102.binary-tree-level-order-traversal 二叉树的层序遍历 Medium Go
0103.binary-tree-zigzag-level-order-traversal 二叉树的锯齿形层序遍历 Medium Go
0104.maximum-depth-of-binary-tree Easy Go
0105.construct-binary-tree-from-preorder-and-inorder-traversal Medium Go
0106.construct-binary-tree-from-inorder-and-postorder-traversal Medium Go
0107.binary-tree-level-order-traversal-ii Medium Go
0108.convert-sorted-array-to-binary-search-tree Easy Go
0109.convert-sorted-list-to-binary-search-tree Medium Go
Go
Go
0110.balanced-binary-tree Easy Go
Go
0111.minimum-depth-of-binary-tree Easy Go
0112.path-sum Easy Go
0113.path-sum-ii Medium Go
0114.flatten-binary-tree-to-linked-list Medium Go
0116.populating-next-right-pointers-in-each-node Medium Go
0124.binary-tree-maximum-path-sum Hard Go
0129.sum-root-to-leaf-numbers Medium Go
0144.binary-tree-preorder-traversal Easy Go
Go
Go
Go
0145.binary-tree-postorder-traversal Easy Go
0156.binary-tree-upside-down Medium Go
0173.binary-search-tree-iterator Medium Go
0199.binary-tree-right-side-view Medium Go
0222.count-complete-tree-nodes Medium Go
Go
0226.invert-binary-tree Easy Go
0230.kth-smallest-element-in-a-bst Medium Go
0235.lowest-common-ancestor-of-a-binary-search-tree Easy Go
0236.lowest-common-ancestor-of-a-binary-tree Medium Go
0250.count-univalue-subtrees Medium Go
0255.verify-preorder-sequence-in-binary-search-tree Medium Go
0257.binary-tree-paths Easy Go
0270.closest-binary-search-tree-value Easy Go
0272.closest-binary-search-tree-value-ii Hard Go
0285.inorder-successor-in-bst Medium Go
0297.serialize-and-deserialize-binary-tree Hard Go
Go
0298.binary-tree-longest-consecutive-sequence Medium Go
0314.binary-tree-vertical-order-traversal 二叉树的垂直遍历 Medium Go
0366.find-leaves-of-binary-tree Medium Go
0404.sum-of-left-leaves Easy Go
0426.convert-binary-search-tree-to-sorted-doubly-linked-list Medium Go
0428.serialize-and-deserialize-n-ary-tree Hard Go
0437.path-sum-iii Medium Go
Go
0449.serialize-and-deserialize-bst Medium Go
0450.delete-node-in-a-bst Medium Go
0501.find-mode-in-binary-search-tree Easy Go
0508.most-frequent-subtree-sum Medium Go
0510.inorder-successor-in-bst-ii Medium Go
0530.minimum-absolute-difference-in-bst Easy Go
0538.convert-bst-to-greater-tree Medium Go
0543.diameter-of-binary-tree Easy Go
0559.maximum-depth-of-n-ary-tree Easy Go
0563.binary-tree-tilt Easy Go
0572.subtree-of-another-tree Easy Go
0589.n-ary-tree-preorder-traversal Easy Go
Go
0590.n-ary-tree-postorder-traversal Easy Go
Go
0606.construct-string-from-binary-tree Easy Go
0617.merge-two-binary-trees Easy Go
0653.two-sum-iv-input-is-a-bst Easy Go
0654.maximum-binary-tree Medium Go
0669.trim-a-binary-search-tree Medium Go
0671.second-minimum-node-in-a-binary-tree Easy Go
0687.longest-univalue-path Medium Go
0700.search-in-a-binary-search-tree Easy Go
0701.insert-into-a-binary-search-tree Medium Go
0783.minimum-distance-between-bst-nodes Easy Go
0814.binary-tree-pruning Medium Go
0865.smallest-subtree-with-all-the-deepest-nodes Medium Go
0872.leaf-similar-trees Easy Go
0889.construct-binary-tree-from-preorder-and-postorder-traversal Medium Go
0897.increasing-order-search-tree Easy Go
0938.range-sum-of-bst Easy Go
0951.flip-equivalent-binary-trees Medium Go
0965.univalued-binary-tree Easy Go
0979.distribute-coins-in-binary-tree Medium Go
1008.construct-binary-search-tree-from-preorder-traversal Medium Go
1022.sum-of-root-to-leaf-binary-numbers Easy Go
1026.maximum-difference-between-node-and-ancestor Medium Go
1038.binary-search-tree-to-greater-sum-tree Medium Go
1104.path-in-zigzag-labelled-binary-tree Medium Go
1123.lowest-common-ancestor-of-deepest-leaves Medium Go
1161.maximum-level-sum-of-a-binary-tree Medium Go
1302.deepest-leaves-sum Medium Go
1315.sum-of-nodes-with-even-valued-grandparent Medium Go
1325.delete-leaves-with-a-given-value Medium Go
1448.count-good-nodes-in-binary-tree Medium Go
1484.clone-binary-tree-with-random-pointer Medium Go
1490.clone-n-ary-tree Medium Go
1560.most-visited-sector-in-a-circular-track Easy Go
1600.throne-inheritance 皇位继承顺序 Medium Go
1602.find-nearest-right-node-in-binary-tree Medium Go
1669.merge-in-between-linked-lists Medium Go
1740.find-distance-in-a-binary-tree Medium Go

Divide&conquer

Title cn Difficulty Solution Algorithm
0014.longest-common-prefix 最长公共前缀 Easy Go

Back

Title cn Difficulty Solution Algorithm
0037.sudoku-solver 解数独 Hard Go
0051.n-queens N 皇后 Hard Go
0052.n-queens-ii N 皇后 II Hard Go
Offer.0038.zi-fu-chuan-de-pai-lie-lcof 字符串的排列 Medium Go

Sort

Title cn Difficulty Solution Algorithm
0179.largest-number 最大数 Medium Go
面试题 17.14. 最小K个数 Medium Go

Search

Title cn Difficulty Solution Algorithm
0011.container-with-most-water 盛最多水的容器 Medium Go
0026.remove-duplicates-from-sorted-array 删除有序数组中的重复项 Easy Go
1838.frequency-of-the-most-frequent-element 最高频元素的频数 Medium Go
1894.find-the-student-that-will-replace-the-chalk 找到需要补充粉笔的学生编号 Medium Go
Offer 53 - I. 在排序数组中查找数字 I Easy Go

LinkedList

Title cn Difficulty Solution Algorithm
0457.circular-array-loop 环形数组是否存在循环 Medium Go Array
0021.merge-two-sorted-lists 合并两个有序链表 Easy Go Merge
0023.merge-k-sorted-lists 合并K个有序链表 Hard Go Merge
0355.design-twitter 设计推特 Medium Go Merge
0024.swap-nodes-in-pairs 两两交换节点 Medium Go Swap
0025.reverse-nodes-in-k-group K 个一组翻转链表 Hard Go
0061.rotate-list 拼接链表 Medium Go
0082.remove-duplicates-from-sorted-list-ii 删除重复全部元素 Medium Go
0083.remove-duplicates-from-sorted-list 删除重复多余元素 Easy Go
0086.partition-list 小于X的靠左 Medium Go
0092.reverse-linked-list-ii 反转链表 Medium Go
0109.convert-sorted-list-to-binary-search-tree 有序链表转二叉搜索树 Medium Go
Go
Go
0138.copy-list-with-random-pointer 深拷贝随机指针链表 Medium Go
0141.linked-list-cycle 是否有环 Easy Go
0142.linked-list-cycle-ii 环的起点 Medium Go
0143.reorder-list 重排链表 Medium Go
0147.insertion-sort-list 插入排序 Medium Go
0160.intersection-of-two-linked-lists 相交起始点 Easy Go
0203.remove-linked-list-elements 删除链表元素 Easy Go
0206.reverse-linked-list 反转链表 Easy Go
0234.palindrome-linked-list 回文链表 Easy Go
0237.delete-node-in-a-linked-list 删除节点 Easy Go
0328.odd-even-linked-list 奇偶链表 Medium Go
0369.plus-one-linked-list 加一 Medium Go
0379.design-phone-directory Medium Go
0430.flatten-a-multilevel-doubly-linked-list 扁平化多级双向链表 Medium Go
0445.add-two-numbers-ii 两数相加 Medium Go
0707.design-linked-list 设计链表 Medium Go
0708.insert-into-a-sorted-circular-linked-list 循环有序列表的插入 Medium Go
0725.split-linked-list-in-parts 分割链表 Medium Go
0817.linked-list-components 链表组件 Medium Go
0876.middle-of-the-linked-list 中间节点 Easy Go
1019.next-greater-node-in-linked-list 下一个更大的值 Medium Go
1171.remove-zero-sum-consecutive-nodes-from-linked-list 从链表中删去总和值为零的连续节点 Medium Go
1290.convert-binary-number-in-a-linked-list-to-integer 二进制链表的值 Easy Go
1367.linked-list-in-binary-tree 二叉树的链表 Medium Go
1474.delete-n-nodes-after-m-nodes-of-a-linked-list 删除m节点后移动n节点 Easy Go
1634.add-two-polynomials-represented-as-linked-lists 多项式合并 Medium Go
Go
1669.merge-in-between-linked-lists 删除区间后合并 Medium Go
1670.design-front-middle-back-queue 队列 Medium Go
1721.swapping-nodes-in-a-linked-list 交换镜像节点 Medium Go
剑指 Offer 22. 链表中倒数第k个节点 Medium Go
剑指 Offer II 023. 两个链表的第一个重合节点 Hard Go

BinarySearch

Title cn Difficulty Solution Algorithm
0004.median-of-two-sorted-arrays 寻找两个正序数组的中位数 Hard Go
0014.longest-common-prefix 最长公共前缀 Easy Go
0033.search-in-rotated-sorted-array 搜索旋转排序数组 Medium Go
0034.find-first-and-last-position-of-element-in-sorted-array 在排序数组中查找元素的第一个和最后一个位置 Medium Go
0035.search-insert-position 搜索插入位置 Easy Go
0069.sqrtx x 的平方根 Easy Go
0081.search-in-rotated-sorted-array-ii 搜索旋转排序数组 II Medium Go
0153.find-minimum-in-rotated-sorted-array 寻找旋转排序数组中的最小值 Medium Go
0154.find-minimum-in-rotated-sorted-array-ii 寻找旋转排序数组中的最小值 II Hard Go
0162.find-peak-element 寻找峰值 Medium Go
0167.two-sum-ii-input-array-is-sorted 两数之和 II - 输入有序数组 Easy Go
0278.first-bad-version 第一个错误版本 Easy Go
0367.valid-perfect-square 有效的完全平方数 Easy Go
0374.guess-number-higher-or-lower 猜数字大小 Easy Go
0441.arranging-coins 排列硬币 Easy Go
0701.insert-into-a-binary-search-tree 二叉搜索树中的插入操作 Medium Go
0744.find-smallest-letter-greater-than-target 寻找比目标字母大的最小字母 Easy Go
0852.peak-index-in-a-mountain-array 山脉数组的峰顶索引 Easy Go
1064.fixed-point 不动点 Easy Go
1150.check-if-a-number-is-majority-element-in-a-sorted-array 检查一个数是否在数组中占绝大多数 Easy Go
1385.find-the-distance-value-between-two-arrays 两个数组间的距离值 Easy Go
1539.kth-missing-positive-number 第 k 个缺失的正整数 Easy Go
1608.special-array-with-x-elements-greater-than-or-equal-x 特殊数组的特征值 Easy Go
LCP 18. 早餐组合 Medium Go
剑指 Offer 11. 旋转数组的最小数字 Medium Go
剑指 Offer 53 - II. 0~n-1中缺失的数字 Easy Go
面试题 08.03. 魔术索引 Medium Go
面试题 10.05. 稀疏数组搜索 Hard Go

Catalan

Title cn Difficulty Solution Algorithm
0022.generate-parentheses Medium Go

StackMonotonic

Title cn Difficulty Solution Algorithm
0042.trapping-rain-water 接雨水 Hard Go

SortCounter

Title cn Difficulty Solution Algorithm

Hash

Title cn Difficulty Solution Algorithm
Cnt Diff Xor ✅ 0389.find-the-difference 找不同 Easy Go
Cnt Heap ❌ 1086.high-five 前五科的均分 Easy Go
Cnt ✅ 0359.logger-rate-limiter 限流器 Easy Go
Cnt ✅ 0604.design-compressed-string-iterator 迭代压缩字符串 Easy Go
Cnt ✅ 0888.fair-candy-swap 糖果棒交换后数量相等 Easy Go
Cnt ✅ 1941.check-if-all-characters-have-equal-number-of-occurrences 检查是否所有字符出现次数相同 Easy Go
Cnt ✅ LCS 02. 完成一半题目最少的题型 Medium Go
Diff ✅ 0299.bulls-and-cows 公牛奶牛 Medium Go
Diff ✅ 0349.intersection-of-two-arrays 两个数组的交集 Easy Go
Diff ✅ 0350.intersection-of-two-arrays-ii 两个数组的交集 II Easy Go
Diff ✅ 0771.jewels-and-stones 找J在S中的数量 Easy Go
Diff ✅ 0819.most-common-word 最常见的单词 Easy Go
Diff ✅ 1002.find-common-characters 查找公共字符 Easy Go
Distance ✅ 1165.single-row-keyboard 机械手最少移动次数 Easy Go
Divide ✅ 1119.remove-vowels-from-a-string 删去字符串中的元音 Easy Go
Divide ✅ 1763.longest-nice-substring 大小写都出现的最长子串 Easy Go
Filter ✅ 0217.contains-duplicate 出现重复 Easy Go
Filter ✅ 0884.uncommon-words-from-two-sentences 两句话中的不常见单词 Easy Go
Filter ✅ 1133.largest-unique-number 最大唯一数 Easy Go
Filter ✅ 1394.find-lucky-integer-in-an-array 找出数组中的幸运数 Easy Go
Filter ✅ 1748.sum-of-unique-elements 唯一元素的和 Easy Go
Filter ✅ 1935.maximum-number-of-words-you-can-type 可以输入的最大单词数 Easy Go
Group GCD ✅ 0914.x-of-a-kind-in-a-deck-of-cards 卡牌分组 Easy Go
Group ✅ 0288.unique-word-abbreviation 单词是唯一缩写 Medium Go
Group ✅ 0348.design-tic-tac-toe 设计井字棋 Medium Go
Group ✅ 0500.keyboard-row 只返回键盘同一行的字母 Easy Go
Group ✅ 0811.subdomain-visit-count 子域名访问次数 Medium Go
Group ✅ 0929.unique-email-addresses 不同的邮件地址数 Easy Go
Group ✅ 1128.number-of-equivalent-domino-pairs 等价多米诺骨牌对的数量 Easy Go
Group ✅ 1275.find-winner-on-a-tic-tac-toe-game 找出井字棋的获胜者 Easy Go
Group ✅ 1399.count-largest-group 统计最大组的数目 Easy Go
Group ✅ 1512.number-of-good-pairs 好数对的数目 i < j && a[i] == a[j] Easy Go
Group ✅ 1742.maximum-number-of-balls-in-a-box 盒子中小球的最大数量 Easy Go
Group ✅ 1805.number-of-different-integers-in-a-string 字符串中不同整数的数目 Easy Go
Group ✅ 2006.count-number-of-pairs-with-absolute-difference-k 差的绝对值为 K 的数对数目 Easy Go
Group ✅ 2032.two-out-of-three 至少在两个数组中出现的值 Easy Go
Link 0356.line-reflection 直线镜像 Medium Go
Link Trie ✅ 0720.longest-word-in-dictionary 词典中连续递接 的最长单词 Easy Go
Link ✅ 0205.isomorphic-strings 同构字符串 Easy Go
Link ✅ 0290.word-pattern 单词规律 Easy Go
Link ✅ 0734.sentence-similarity 句子相似性 Easy Go
Link ✅ 0760.find-anagram-mappings 找A在B的位置 Easy Go
Link ✅ 0953.verifying-an-alien-dictionary 验证外星语词典 Easy Go
Link ✅ 1122.relative-sort-array 数组的相对排序 Easy Go
Link ✅ 1331.rank-transform-of-an-array 数组序号转换 Easy Go
Link ✅ 1346.check-if-n-and-its-double-exist 检查整数及其两倍数是否存在 Easy Go
Link ✅ 1370.increasing-decreasing-string 上升下降字符串 Easy Go
Link ❌ 0244.shortest-word-distance-ii 最短单词距离 II Medium Go
Link ❌ 0599.minimum-index-sum-of-two-lists 相同值的最小索引总和 Easy Go
Link ❌ 1640.check-array-formation-through-concatenation 能否连接形成数组 Easy Go
Link ❌ 2007.find-original-array-from-doubled-array 从双倍数组中还原原数组 Medium Go
Link ❌ 2013.detect-squares 检测正方形 Medium Go
Moore 投票 ✅ 0169.majority-element 众数 Easy Go
Moore 投票 ❌ 0229.majority-element-ii 求众数 II Medium Go
Permutation ✅ 0128.longest-consecutive-sequence 最长递增 🤚 偏移 Medium Go
Permutation ✅ 0242.valid-anagram 有效的字母异位词 🤚 Easy Go
Permutation ✅ 0266.palindrome-permutation 有效回文 Easy Go
Permutation ✅ 0383.ransom-note 全排列 == 子排列 Easy Go
Permutation ✅ 0409.longest-palindrome 最长回文串 Easy Go
Permutation ✅ 0575.distribute-candies 分糖果 🤚 最多类型 Easy Go
Permutation ✅ 0594.longest-harmonious-subsequence 最长相差 1 子排列 🤚 偏移 Easy Go
Permutation ✅ 0748.shortest-completing-word 最短补全词 Easy Go
Permutation ✅ 0859.buddy-strings 交换一次后字符串相等 Easy Go
Permutation ✅ 1160.find-words-that-can-be-formed-by-characters 拼写单词 Easy Go
Permutation ✅ 1189.maximum-number-of-balloons “气球” 的最大数量 Easy Go
Permutation ✅ 1426.counting-elements 存在 (值+1 的后置元素) 的元素个数 🤚 偏移 Easy Go
Permutation ✅ 1460.make-two-arrays-equal-by-reversing-sub-arrays 通过翻转子数组使两个数组相等 Easy Go
Pre ✅ 0930.binary-subarrays-with-sum 和相同的二元子数组 Medium Go
Pre ❌ 1711.count-good-meals 大餐计数 Medium Go
Queue ✅ 0362.design-hit-counter 敲击计数器 Medium Go
Scope ✅ 0041.first-missing-positive 缺失的首个正数 🤚 剔除 标记 筛选 Hard Go
Score ✅ 0442.find-all-duplicates-in-an-array 等值数组中 重复的数 🤚 偏移 标记 Medium Go
Score ✅ 0448.find-all-numbers-disappeared-in-an-array 等值数组中 消失的数 🤚 偏移 标记 筛选 Easy Go
Score ✅ 1636.sort-array-by-increasing-frequency 按照频率将数组升序排序 🤚 权重 Easy Go
Score ✅ 1796.second-largest-digit-in-a-string 字符串中第二大的数字 Easy Go
Score ❌ 0387.first-unique-character-in-a-string 字符串中的第一个唯一字符 🤚 标记索引 剔除 Easy Go
Vector ✅ 0049.group-anagrams 字母异位词分组 Medium Go
Vector ✅ 0249.group-shifted-strings 移位字符串分组 Medium Go
Vector ✅ 0438.find-all-anagrams-in-a-string 找到字符串中所有字母异位词 Medium Go
Window Divide ❌ 0395.longest-substring-with-at-least-k-repeating-characters 至少包含 K 个重复字符的最长子串 Medium Go
Window ✅ 0003.longest-substring-without-repeating-characters 无重复的最长子串 Medium Go
Window ✅ 0159.longest-substring-with-at-most-two-distinct-characters 至多包含两个不同字符的最长子串 Medium Go
Window ✅ 0219.contains-duplicate-ii 两个重复元素距离小于等于K Easy Go
Window ✅ 0246.strobogrammatic-number 中心对称数 Easy Go
Window ✅ 0697.degree-of-an-array 度相同的最短连续子数组 Easy Go
Window ✅ 0961.n-repeated-element-in-size-2n-array 2N 中重复 N 次的元素 Easy Go
Window ✅ 1624.largest-substring-between-two-equal-characters 两个相同字符之间的最长子字符串 Easy Go
Window ❌ 0325.maximum-size-subarray-sum-equals-k 和等于 k 的最长子数组长度 Medium Go
Window ❌ 0340.longest-substring-with-at-most-k-distinct-characters 至多包含 K 个不同字符的最长子串 Medium Go

Greedy

Title cn Difficulty Solution Algorithm
0045.jump-game-ii 跳跃游戏 II Medium Go
0055.jump-game 跳跃游戏 Medium Go
0134.gas-station 加油站 Medium Go
0135.candy 分发糖果 Hard Go
0678.valid-parenthesis-string 有效的括号字符串 Medium Go

Dp

Title cn Difficulty Solution Algorithm
0005.longest-palindromic-substring 最长回文 Medium Go
0010.regular-expression-matching .* 正则匹配 Hard Go
0032.longest-valid-parentheses 最长有效括号 Hard Go
0042.trapping-rain-water 接雨水 Hard Go
0044.wildcard-matching * ?通配符 Hard Go
0053.maximum-subarray 最大子序和 Easy Go
0062.unique-paths 不同路径 Medium Go
0063.unique-paths-ii 不同路径 II Medium Go
0064.minimum-path-sum 最小路径和 Medium Go
0070.climbing-stairs 爬楼梯 Easy Go
0072.edit-distance 编辑距离 Hard Go
0087.scramble-string 扰乱字符串 Hard Go
0091.decode-ways 解码方法 Medium Go
0097.interleaving-string 交错字符串 Medium Go
0115.distinct-subsequences 不同的子序列 Hard Go
0118.pascals-triangle 杨辉三角 Easy Go
0119.pascals-triangle-ii 杨辉三角 II Easy Go
0120.triangle 三角形最小路径 Medium Go
0121.best-time-to-buy-and-sell-stock 买卖股票的最佳时机 Easy Go
0123.best-time-to-buy-and-sell-stock-iii 买卖股票的最佳时机 III Hard Go
0139.word-break 单词拆分 Medium Go
0279.perfect-squares 完全平方数 Medium Go
0303.range-sum-query-immutable 区域和检索 - 数组不可变 Easy Go
0322.coin-change 零钱兑换 Medium Go
0474.ones-and-zeroes 一和零 Medium Go
0509.fibonacci-number 斐波那契数 Easy Go
0518.coin-change-2 零钱兑换 II Medium Go
0523.continuous-subarray-sum 连续子数组和 K的倍数 Medium Go
0525.contiguous-array 连续数组 Medium Go
0650.2-keys-keyboard 只有两个键的键盘 Medium Go
0877.stone-game 石头游戏 Medium Go
1480.running-sum-of-1d-array 数组前缀和 Easy Go
1744.can-you-eat-your-favorite-candy-on-your-favorite-day 你能在你最喜欢的那天吃到你最喜欢的糖果吗? Medium Go
1769.minimum-number-of-operations-to-move-all-balls-to-each-box 移动所有球到每个盒子所需的最小操作数 Medium Go
5876.sum-of-beauty-in-the-array 数组美丽值求和 Hard Go
Go

Classic

Title cn Difficulty Solution Algorithm
0005.longest-palindromic-substring 最长回文子串 (manacher) Medium Go
0028.implement-strstr 实现 strStr() (kmp) Easy Go

Math

Title cn Difficulty Solution Algorithm
0007.reverse-integer Easy Go
0008.string-to-integer-atoi Medium Go
0009.palindrome-number Easy Go
0012.integer-to-roman Medium Go
0013.roman-to-integer Easy Go
0029.divide-two-integers Medium Go
0031.next-permutation Medium Go
0043.multiply-strings 字符串相乘 Medium Go
0066.plus-one 加一 Easy Go
0165.compare-version-numbers 比较版本号 Medium Go
0166.fraction-to-recurring-decimal 分数到小数 Medium Go
0191.number-of-1-bits Easy Go
0263.ugly-number 丑数 Easy Go
0268.missing-number 丢失的数字 Easy Go
0292.nim-game Easy Go
0319.bulb-switcher Medium Go
0415.add-strings 字符串相加 Easy Go
0453.minimum-moves-to-equal-array-elements 最小操作次数使数组元素相等 Easy Go
0470.implement-rand10-using-rand7 用 Rand7() 实现 Rand10() Medium Go
0478.generate-random-point-in-a-circle 在圆内随机生成点 Medium Go
0492.construct-the-rectangle 构造矩形 Easy Go
0877.stone-game 石头游戏 Medium Go
1025.divisor-game 除数博弈 Easy Go
1266.minimum-time-visiting-all-points Easy Go
1281.subtract-the-product-and-sum-of-digits-of-an-integer Easy Go
1313.decompress-run-length-encoded-list Easy Go
1403.minimum-subsequence-in-non-increasing-order Easy Go
1791.find-center-of-star-graph Easy Go
Cnt # LCP 11. 期望个数统计 Medium Go

Sql

Title cn Difficulty Solution Algorithm
0175.combine-two-tables 给所有人加上地址 Easy Go
0176.second-highest-salary 找第二名 Null 也返回 Medium Go
0177.nth-highest-salary 找第N名 Null 也返回 Medium Go
0178.rank-scores 稠密排行 Medium Go
0180.consecutive-numbers 连续出现3次的数字 Medium Go
0181.employees-earning-more-than-their-managers 超过经理收入的员工 Easy Go
0182.duplicate-emails 找重复邮箱 Easy Go
0183.customers-who-never-order 从不订购的客户 Easy Go
0184.department-highest-salary 部门最高工资的员工 Medium Go
0185.department-top-three-salaries 部门工资前三高的员工 Hard Go
0196.delete-duplicate-emails 删除重复邮箱 Easy Go
0197.rising-temperature 温度相比昨天是上升的 Easy Go
0262.trips-and-users 非禁止用户取消率 Hard Go
0511.game-play-analysis-i 首次登陆的时间 Easy Go
0512.game-play-analysis-ii 首次登陆的设备名称 Easy Go
0534.game-play-analysis-iii 每人每天累积多少时长 Medium Go
0550.game-play-analysis-iv 首日后隔天登录玩家的比率 Medium Go
0569.median-employee-salary 每个公司薪酬中位数 Hard Go
0570.managers-with-at-least-5-direct-reports 至少5名下属的经理 Medium Go
0571.find-median-given-frequency-of-numbers 频率数字的中位数 Hard Go
0574.winning-candidate 当选者 Medium Go
0577.employee-bonus 员工奖金 Easy Go
0578.get-highest-answer-rate-question 回答率最高的问题 Medium Go
0579.find-cumulative-salary-of-an-employee 员工累积薪水 Hard Go
0580.count-student-number-in-departments 各专业学生人数 Medium Go
0584.find-customer-referee 用户的推荐人 Easy Go
0585.investments-in-2016 2016 年的投资 Medium Go
0586.customer-placing-the-largest-number-of-orders 订单最多的客户 Easy Go
0595.big-countries 大的国家 Easy Go
0596.classes-more-than-5-students 超过5名学生的课 Easy Go
0597.friend-requests-i-overall-acceptance-rate 好友申请总体通过率 Easy Go
0601.human-traffic-of-stadium 人流量 Hard Go
0602.friend-requests-ii-who-has-the-most-friends 谁有最多的好友 Medium Go
0603.consecutive-available-seats 连续空余座位 Easy Go
0607.sales-person 销售员 Easy Go
0608.tree-node 树节点 Medium Go
0610.triangle-judgement 判断三角形 Easy Go
0612.shortest-distance-in-a-plane 平面上的最近距离 Medium Go
0613.shortest-distance-in-a-line 直线上的最近距离 Easy Go
0614.second-degree-follower 二级关注者 Medium Go
0615.average-salary-departments-vs-company 平均工资:部门与公司比较 Hard Go
0618.students-report-by-geography 学生地理信息报告 Hard Go
0619.biggest-single-number 最出现一次的最大数字 Easy Go
0620.not-boring-movies 有趣的电影 Easy Go
0626.exchange-seats 换座位 Medium Go
0627.swap-salary 变更性别 Easy Go
1045.customers-who-bought-all-products 买下所有产品的客户 Medium Go
1050.actors-and-directors-who-cooperated-at-least-three-times 合作至少三次的演员和导员 Easy Go
1068.product-sales-analysis-i 产品的年份和价格 Easy Go
1069.product-sales-analysis-ii 产品的销售总额 Easy Go
1070.product-sales-analysis-iii 第一年的价格 Medium Go
1075.project-employees-i 项目的平均年限 Easy Go
1076.project-employees-ii 员工最多的项目 销售额最高的销售者 Easy Go
1077.project-employees-iii 项目经济最丰富的员工 Medium Go
1082.sales-analysis-i 销售额最高的销售者 Easy Go
1083.sales-analysis-ii 买 S8 却没有 iPhone 的买家 Easy Go
1084.sales-analysis-iii 只在春季销售的产品 Easy Go
1097.game-play-analysis-v 第二天留存率 Hard Go
1098.unpopular-books 过去一年少于十本的书 Medium Go
1107.new-users-daily-count 每日新用户 Medium Go
1112.highest-grade-for-each-student 最高分数的学科 Medium Go
1113.reported-posts 不同的报告记录 Easy Go
1126.active-businesses 活跃的业务 Medium Go
1127.user-purchase-platform 统计单端或双端人数 Hard Go
1132.reported-posts-ii 垃圾清除率 Medium Go
1141.user-activity-for-the-past-30-days-i 近30天活跃数 Easy Go
1142.user-activity-for-the-past-30-days-ii 平均会话次数 Easy Go
1148.article-views-i 浏览过自己文章的作者 Easy Go
1149.article-views-ii 一天浏览过两篇文章的人 Medium Go
1158.market-analysis-i 统计2019年订单总数 Medium Go
1159.market-analysis-ii 售出第二件不是喜欢的商品 Hard Go
1164.product-price-at-a-given-date 变更后的价格 Medium Go
1173.immediate-food-delivery-i 当天配送率 Easy Go
1174.immediate-food-delivery-ii 首日即时配送订单 Medium Go
1179.reformat-department-table 格式化工资 Easy Go
1193.monthly-transactions-i 统计 Medium Go
1194.tournament-winners 每组的优胜者 Hard Go
1204.last-person-to-fit-in-the-elevator 最后进入电梯 Medium Go
1205.monthly-transactions-ii 交易统计 Medium Go
1211.queries-quality-and-percentage Easy Go
1212.team-scores-in-football-tournament 计算得分 Medium Go
1225.report-contiguous-dates 统计连续 Hard Go
1241.number-of-comments-per-post 查询评论数 Easy Go
1251.average-selling-price Easy Go
1264.page-recommendations 推荐朋友喜欢的页面 Medium Go
1270.all-people-report-to-the-given-manager 递归查询 Medium Go
1280.students-and-examinations 学生各科测试次数 Easy Go
1285.find-the-start-and-end-number-of-continuous-ranges 区间次数 Medium Go
1294.weather-type-in-each-country 11 月份的天气 Easy Go
1303.find-the-team-size 团队人数 Easy Go
1308.running-total-for-different-genders 男女的累积分数 Medium Go
1321.restaurant-growth 最近七天平均值 Medium Go
1322.ads-performance 广告效果统计 Easy Go
1327.list-the-products-ordered-in-a-period 指定日期总数 Easy Go
1336.number-of-transactions-per-visit 每次访问的交易次数 Hard Go
1341.movie-rating 评论数和评分数统计 Medium Go
1350.students-with-invalid-departments 不存在院校的学生 Easy Go
1355.activity-participants 去除第一和倒数第一 Medium Go
1364.number-of-trusted-contacts-of-a-customer 互为好友的顾客 Medium Go
1369.get-the-second-most-recent-activity 倒数第二次活动 Hard Go
1378.replace-employee-id-with-the-unique-identifier 使用uuid替换id Easy Go
1384.total-sales-amount-by-year 年度统计 Hard Go
1393.capital-gainloss 资本损益 Medium Go
1398.customers-who-bought-products-a-and-b-but-not-c 买AB不买C Medium Go
1407.top-travellers 旅行距离排名 Easy Go
1412.find-the-quiet-students-in-all-exams 成绩中游学生 Hard Go
1418.display-table-of-food-orders-in-a-restaurant 点菜展示表 Medium Go
1421.npv-queries 连表 Easy Go
1435.create-a-session-bar-chart 分段汇总 Easy Go
1440.evaluate-boolean-expression 连表比较 Medium Go
1445.apples-oranges 销量差 Medium Go
1454.active-users 连续7天在线的用户 Medium Go
1459.rectangles-area 组合成矩形 Medium Go
1468.calculate-salaries 扣税 Medium Go
1479.sales-by-day-of-the-week 每周销量统计 Hard Go
1485.group-sold-products-by-the-date group 聚合 Easy Go
1495.friendly-movies-streamed-last-month 儿童适宜的电影 Easy Go
1501.countries-you-can-safely-invest-in 通话时长高于平均 Medium Go
1511.customer-order-frequency 六七月消费大于等于100 Easy Go
1517.find-users-with-valid-e-mails 邮箱正则 Easy Go
1527.patients-with-a-condition 患病患者 Easy Go
1532.the-most-recent-three-orders 最近三笔订单 Medium Go
1543.fix-product-name-format 格式化 Easy Go
1549.the-most-recent-orders-for-each-product 产品最新订单 Medium Go
1555.bank-account-summary 是否透支 Medium Go
1565.unique-orders-and-customers-per-month 月订单数和顾客数 Easy Go
1571.warehouse-manager 计算立方 Easy Go
1581.customer-who-visited-but-did-not-make-any-transactions 进店未交易 Easy Go
1587.bank-account-summary-ii 余大于10000的用户 Easy Go
1596.the-most-frequently-ordered-products-for-each-customer 经常订购的商品 Medium Go
1607.sellers-with-no-sales 没有卖出产品的销售 Easy Go
1613.find-the-missing-ids 缺失的id Medium Go
1623.all-valid-triplets-that-can-represent-a-country 三个学校组合不同的代表队 Easy Go
1633.percentage-of-users-attended-a-contest 注册率 Easy Go
1635.hopper-company-queries-i 活跃数与行程数 Hard Go
1645.hopper-company-queries-ii 工作率 Hard Go
1651.hopper-company-queries-iii 平均距离和平均时间 Hard Go
1661.average-time-of-process-per-machine 平均运行时间 Easy Go
1667.fix-names-in-a-table 修复名字 Easy Go
1677.products-worth-over-invoices 统计 Easy Go
1683.invalid-tweets 无效推文 Easy Go
1693.daily-leads-and-partners 统计 Easy Go
1699.number-of-calls-between-two-persons 通话次数 Medium Go
1709.biggest-window-between-visits 日期缺失 Medium Go
1715.count-apples-and-oranges 统计 Medium Go
1729.find-followers-count 关注数 Easy Go
1731.the-number-of-employees-which-report-to-each-employee 每位经理有多少下属 Easy Go
1741.find-total-time-spent-by-each-employee 员工花费时间 Easy Go
1747.leetflex-banned-accounts 应被禁止的账户 Medium Go
1757.recyclable-and-low-fat-products 可回收且低脂的产品 Easy Go
1767.find-the-subtasks-that-did-not-execute 找到未执行的子任务 Hard Go
1777.products-price-for-each-store 每家商店价格 Easy Go
1783.grand-slam-titles 大满贯数 Medium Go
1789.primary-department-for-each-employee 员工的主要部门 Easy Go
1795.rearrange-products-table 商品价格合并 Easy Go
1809.ad-free-sessions 没有展示广告的会话 Easy Go
1811.find-interview-candidates 统计 Medium Go
1821.find-customers-with-positive-revenue-this-year 正收入 Easy Go
1831.maximum-transaction-each-day 每天最大交易 Medium Go

About

🌓in the dead of night

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.9%
  • JavaScript 0.1%