{"id":20447997,"url":"https://github.com/yi-ge/typescript-practice","last_synced_at":"2025-04-13T01:12:17.896Z","repository":{"id":37708908,"uuid":"174789857","full_name":"yi-ge/typescript-practice","owner":"yi-ge","description":"TypeScript 算法练习。","archived":false,"fork":false,"pushed_at":"2023-12-07T03:16:31.000Z","size":10978,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T01:11:46.121Z","etag":null,"topics":["algorithms","leetcode","leetcode-solutions","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yi-ge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-03-10T07:09:14.000Z","updated_at":"2024-06-27T23:23:01.000Z","dependencies_parsed_at":"2023-12-06T03:08:57.578Z","dependency_job_id":"9dddf025-bb82-4975-bc1a-bc451c6b68c7","html_url":"https://github.com/yi-ge/typescript-practice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yi-ge%2Ftypescript-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yi-ge%2Ftypescript-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yi-ge%2Ftypescript-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yi-ge%2Ftypescript-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yi-ge","download_url":"https://codeload.github.com/yi-ge/typescript-practice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650753,"owners_count":21139681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","leetcode","leetcode-solutions","typescript"],"created_at":"2024-11-15T10:31:34.679Z","updated_at":"2025-04-13T01:12:17.853Z","avatar_url":"https://github.com/yi-ge.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript 算法练习\n\n[![license](https://img.shields.io/github/license/yi-ge/typescript-practice.svg?style=flat-square)](https://github.com/yi-ge/typescript-practice/blob/master/LICENSE)\n[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fyi-ge%2Ftypescript-practice%2Fbadge%3Fref%3Dmain\u0026style=flat-square)](https://actions-badge.atrox.dev/yi-ge/typescript-practice/goto?ref=main)\n[![Test Results](https://gist.github.com/yi-ge/d68fa5b85788ef50447630fff106866c/raw/badge.svg)](https://github.com/yi-ge/typescript-practice)\n[![Coveralls github](https://img.shields.io/coveralls/github/yi-ge/typescript-practice?style=flat-square)](https://coveralls.io/github/yi-ge/typescript-practice?branch=main)\n[![GitHub last commit](https://img.shields.io/github/last-commit/yi-ge/typescript-practice.svg?style=flat-square)](https://github.com/yi-ge/typescript-practice)\n[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod\u0026style=flat-square)](https://gitpod.io/#https://github.com/yi-ge/typescript-practice)\n\n[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)\n\nTypeScript / JavaScript 基础算法、数据结构练习，包含 LeetCode 或其它算法练习记录。\n\n此为个人练习仓库，代码中对重要思想进行了注释，~~但是没有详细的解题思路~~后续会尽量补充解题思路。\n\n每一道题都对应写有测试用例，但可能不够完整。如果您发现错误，欢迎给我留言，谢谢！\n\n需安装 `Node.js` v18.6.0+，`yarn` 1.22.x。\n\n运行`yarn`安装依赖，然后运行`yarn start`可以自动从LeetCode获取代码函数和用例说明。保存文件后将自动同步到浏览器（比起VScode的LeetCode插件，此方法可以借助Wallaby获得更快和更友好的调试结果，支持Linux、MacOS、Windows）。\n\n特别说明：部分题目截图仅为了方便在代码编辑器中直接预览从而优化编码体验，LeetCode题目以LeetCode官方页面为准，题目著作权及其他权利以LeetCode官方说明为准或属于LeetCode。已标注其来源的内容，版权均属于原作者。\n\n请大家尊重版权，共同维护良好网络环境。\n\n## 基础排序算法\n\n- [插入排序](src/sort/insertSort.ts)\n- [冒泡排序](src/sort/bubbleSort.ts)\n- [选择排序](src/sort/selectSort.ts)\n- [快速排序](src/sort/quickSort.ts)\n- [归并排序](src/sort/mergeSort.ts)\n\n## 基础数据结构\n\n### ECMAScript标准内置的数据结构（部分）\n\n- [数组及数组操作（栈、队列）](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array)\n- [集合 Set](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set)\n- [键 - 值对 Map](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map)\n\n### 通过JavaScript实现的数据结构及其常见操作\n\n- [二叉树深度优先遍历|前序遍历|中序遍历|后序遍历](src/tree/dfs.ts)\n- [二叉树广度优先遍历|层序遍历](src/tree/bfs.ts)\n- [链表结点](src/lib/ListNode.ts)\n- [树结点](src/lib/TreeNode.ts)\n- [堆操作](src/lib/Heap.ts)\n\n## 算法题\n\n### 字符串\n\n- [检查二进制字符串字段](src/string/check-if-binary-string-has-at-most-one-segment-of-ones.ts)  [字符串]\n\n  - LeetCode 1784. 检查二进制字符串字段 \u003chttps://leetcode.cn/problems/check-if-binary-string-has-at-most-one-segment-of-ones/\u003e\n\n- [数组中的字符串匹配](src/string/string-matching-in-an-array.ts)  [字符串, 字符串匹配]\n\n  - LeetCode 1408. 数组中的字符串匹配 \u003chttps://leetcode.cn/problems/string-matching-in-an-array\u003e\n\n- [生成每种字符都是奇数个的字符串](src/string/generate-a-string-with-characters-that-have-odd-counts.ts)  [字符串]\n\n  - LeetCode 1374. 生成每种字符都是奇数个的字符串 \u003chttps://leetcode.cn/problems/generate-a-string-with-characters-that-have-odd-counts\u003e\n\n- [反转字符串中的单词](src/string/reverse-words-in-a-string.ts)\n\n  - LeetCode 557. 反转字符串中的单词 III \u003chttps://leetcode-cn.com/problems/reverse-words-in-a-string-iii/\u003e\n  - LintCode 1173. 反转字符串 III \u003chttps://www.lintcode.com/problem/reverse-words-in-a-string-iii/description\u003e\n\n- [计数二进制子串](src/string/count-binary-substrings.ts)\n\n  - LeetCode 696. 计数二进制子串 \u003chttps://leetcode-cn.com/problems/count-binary-substrings/\u003e\n  - LintCode 1079. 连续子串计数 \u003chttps://www.lintcode.com/problem/count-binary-substrings/description\u003e\n\n- [重复的子串](src/string/repeated-substring-pattern.ts)\n\n  - LeetCode 459. 重复的子字符串 \u003chttps://leetcode-cn.com/problems/repeated-substring-pattern/\u003e\n  - LintCode 1227. 重复的子串模式 \u003chttps://www.lintcode.com/problem/repeated-substring-pattern/description\u003e\n\n- [正则表达式匹配](src/string/regular-expression-matching.ts)\n\n  - LeetCode 10. 正则表达式匹配 \u003chttps://leetcode-cn.com/problems/regular-expression-matching/\u003e\n  - LintCode 154. 正则表达式匹配 \u003chttps://www.lintcode.com/problem/regular-expression-matching/description\u003e\n\n- [恢复 IP 地址](src/string/restore-ip-addresses.ts)\n\n  - LeetCode 93. 复原 IP 地址 \u003chttps://leetcode-cn.com/problems/restore-ip-addresses/\u003e\n  - LintCode 426. 恢复 IP 地址 \u003chttps://www.lintcode.com/problem/restore-ip-addresses/description\u003e\n\n- [存在重复元素](src/string/contains-duplicate.ts)\n\n  - LeetCode 217. 存在重复元素 \u003chttps://leetcode-cn.com/problems/contains-duplicate/\u003e\n\n- [判断字符串是否没有重复字符](src/string/unique-characters.ts)\n\n  - LintCode 157. 判断字符串是否没有重复字符 \u003chttps://www.lintcode.com/problem/unique-characters/description\u003e\n\n- [比较字符串](src/string/compare-strings.ts)\n\n  - LintCode 55. 比较字符串 \u003chttps://www.lintcode.com/problem/compare-strings/description\u003e\n\n- [最长无重复字符的子串](src/string/longest-substring-without-repeating-characters.ts)\n\n  - LeetCode 3. 无重复字符的最长子串 \u003chttps://leetcode-cn.com/problems/longest-substring-without-repeating-characters/\u003e\n  - LintCode 384. 最长无重复字符的子串 \u003chttps://www.lintcode.com/problem/longest-substring-without-repeating-characters/description\u003e\n\n- [最大数](src/string/largest-number.ts)\n\n  - LeetCode 179. 最大数 \u003chttps://leetcode-cn.com/problems/largest-number/\u003e\n  - LintCode 184. 最大数 \u003chttps://www.lintcode.com/problem/largest-number/description\u003e\n\n- [实现 string2int()函数](src/string/string2int.ts)\n\n  - 面试题参考思路，不严谨实现 廖雪峰 不要使用 JavaScript 内置的 parseInt()函数，利用 map 和 reduce 操作实现一个 string2int()函数。 \u003chttps://www.liaoxuefeng.com/wiki/1022910821149312/1024322552460832\u003e\n\n- [左旋转字符串](src/string/zuo-xuan-zhuan-zi-fu-chuan-lcof.ts)\n\n  - LeetCode 面试题 58 - II. 左旋转字符串 \u003chttps://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/\u003e\n\n- [最后一个单词的长度](src/string/length-of-last-word.ts)\n\n  - LeetCode 58. 最后一个单词的长度 \u003chttps://leetcode-cn.com/problems/length-of-last-word/\u003e\n  - LintCode 422. 最后一个单词的长度 \u003chttps://www.lintcode.com/problem/length-of-last-word/description\u003e\n\n- [整数转罗马数字](src/string/integer-to-roman.ts)\n\n  - LeetCode 12. 整数转罗马数字 \u003chttps://leetcode-cn.com/problems/integer-to-roman/\u003e\n  - LintCode 418. 整数转罗马数字 \u003chttps://www.lintcode.com/problem/integer-to-roman/description\u003e\n\n- [罗马数字转整数](src/string/roman-to-integer.ts)\n\n  - LeetCode 13. 罗马数字转整数 \u003chttps://leetcode-cn.com/problems/roman-to-integer/\u003e\n  - LintCode 419. 罗马数字转整数 \u003chttps://www.lintcode.com/problem/roman-to-integer/description\u003e\n\n- [验证回文字符串 Ⅱ](src/string/valid-palindrome-ii.ts)\n\n  - LeetCode 680. 验证回文字符串 Ⅱ \u003chttps://leetcode-cn.com/problems/valid-palindrome-ii/\u003e\n  - LintCode 891. 有效回文 II \u003chttps://www.lintcode.com/problem/valid-palindrome-ii/description\u003e\n\n- [IP 地址无效化](src/string/defanging-an-ip-address.ts)\n\n  - LeetCode 1108. IP 地址无效化 \u003chttps://leetcode-cn.com/problems/defanging-an-ip-address/\u003e\n\n- [最长回文子串](src/string/longest-palindromic-substring.ts)\n\n  - LeetCode 5. 最长回文子串 \u003chttps://leetcode-cn.com/problems/longest-palindromic-substring/\u003e\n  - LintCode 200. 最长回文子串 \u003chttps://www.lintcode.com/problem/longest-palindromic-substring/\u003e\n\n- [每个元音包含偶数次的最长子字符串](src/string/find-the-longest-substring-containing-vowels-in-even-counts.ts)\n\n  - LeetCode 1371. 每个元音包含偶数次的最长子字符串 \u003chttps://leetcode-cn.com/problems/find-the-longest-substring-containing-vowels-in-even-counts/\u003e\n\n- [最小覆盖子串](src/string/minimum-window-substring.ts)\n\n  - LeetCode 76. 最小覆盖子串 \u003chttps://leetcode-cn.com/problems/minimum-window-substring/\u003e\n  - LintCode 32. 最小子串覆盖 \u003chttps://www.lintcode.com/problem/minimum-window-substring/description\u003e\n\n- [检查单词是否为句中其他单词的前缀](src/string/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.ts)\n\n  - LeetCode 5416. 检查单词是否为句中其他单词的前缀 \u003chttps://leetcode-cn.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/\u003e\n\n- [定长子串中元音的最大数目](src/string/maximum-number-of-vowels-in-a-substring-of-given-length.ts)\n\n  - LeetCode 5417. 定长子串中元音的最大数目 \u003chttps://leetcode-cn.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length/\u003e\n\n- [最长公共前缀](src/string/longest-common-prefix.ts)\n\n  - LeetCode 14. 最长公共前缀 \u003chttps://leetcode-cn.com/problems/longest-common-prefix/\u003e\n  - LintCode 78. 最长公共前缀 \u003chttps://www.lintcode.com/problem/longest-common-prefix/description\u003e\n\n- [括号生成](src/string/generate-parentheses.ts)\n\n  - LeetCode 22. 括号生成 \u003chttps://leetcode.cn/problems/generate-parentheses/\u003e\n\n- [为运算表达式设计优先级](src/string/different-ways-to-add-parentheses.ts)\n\n  - LeetCode 241. 为运算表达式设计优先级 \u003chttps://leetcode.cn/problems/different-ways-to-add-parentheses/\u003e\n\n### 数组/队列/集合/映射\n\n- [打家劫舍](src/array/house-robber.ts)  [数组, 动态规划]\n\n  - LeetCode 198. 打家劫舍 \u003chttps://leetcode.cn/problems/house-robber\u003e\n\n- [水果成篮](src/array/fruit-into-baskets.ts)  [数组, 哈希表, 滑动窗口]\n\n  - LeetCode 904. 水果成篮 \u003chttps://leetcode.cn/problems/fruit-into-baskets\u003e\n\n- [最短单词距离](src/array/shortest-word-distance.ts)  [数组, 字符串]\n\n  - LeetCode 243. 最短单词距离 \u003chttps://leetcode.cn/problems/shortest-word-distance/\u003e\n\n- [拆炸弹](src/array/defuse-the-bomb.ts)  [数组]\n\n  - LeetCode 1652. 拆炸弹 \u003chttps://leetcode.cn/problems/defuse-the-bomb\u003e\n\n- [统计好三元组](src/array/count-good-triplets.ts)  [数组, 枚举]\n\n  - LeetCode 1534. 统计好三元组 \u003chttps://leetcode.cn/problems/count-good-triplets/\u003e\n\n- [雇佣 K 名工人的最低成本](src/array/minimum-cost-to-hire-k-workers.ts)  [贪心, 数组, 排序, 堆（优先队列）]\n\n  - LeetCode 857. 雇佣 K 名工人的最低成本 \u003chttps://leetcode.cn/problems/minimum-cost-to-hire-k-workers\u003e\n\n- [螺旋矩阵](src/array/spiral-matrix.ts)  [数组, 矩阵, 模拟]\n\n  - LeetCode 54. 螺旋矩阵 \u003chttps://leetcode.cn/problems/spiral-matrix/\u003e\n\n- [二进制矩阵中的特殊位置](src/array/special-positions-in-a-binary-matrix.ts)  [数组, 矩阵]\n\n  - LeetCode 1582. 二进制矩阵中的特殊位置 \u003chttps://leetcode.cn/problems/special-positions-in-a-binary-matrix\u003e\n\n- [最长数对链](src/array/maximum-length-of-pair-chain.ts)  [贪心, 数组, 动态规划, 排序]\n\n  - LeetCode 646. 最长数对链 \u003chttps://leetcode.cn/problems/maximum-length-of-pair-chain\u003e\n\n- [公交站间的距离](src/array/distance-between-bus-stops.ts)  [数组]\n\n  - LeetCode 1184. 公交站间的距离 \u003chttps://leetcode.cn/problems/distance-between-bus-stops\u003e\n\n- [存在重复元素 III](src/array/contains-duplicate-iii.ts)  [数组, 桶排序, 有序集合, 排序, 滑动窗口]\n\n  - LeetCode 220. 存在重复元素 III \u003chttps://leetcode.cn/problems/contains-duplicate-iii/\u003e\n\n- [回旋镖的数量](src/array/number-of-boomerangs.ts)  [数组, 哈希表, 数学]\n\n  - LeetCode 447. 回旋镖的数量 \u003chttps://leetcode.cn/problems/number-of-boomerangs/\u003e\n\n- [四数相加 II](src/array/4sum-ii.ts)  [数组, 哈希表]\n\n  - LeetCode 454. 四数相加 II \u003chttps://leetcode.cn/problems/4sum-ii/\u003e\n\n- [有序转化数组](src/array/sort-transformed-array.ts)  [数组, 数学, 双指针, 排序]\n\n  - LeetCode 360. 有序转化数组 \u003chttps://leetcode.cn/problems/sort-transformed-array/\u003e\n\n- [电话号码的字母组合](src/array/letter-combinations-of-a-phone-number.ts)\n\n  - LeetCode 17. 电话号码的字母组合 \u003chttps://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/\u003e\n  - LintCode 425. 电话号码的字母组合 \u003chttps://www.lintcode.com/problem/letter-combinations-of-a-phone-number/description\u003e\n\n- [卡牌分组](src/array/x-of-a-kind-in-a-deck-of-cards.ts)\n\n  - LeetCode 914. 卡牌分组 \u003chttps://leetcode-cn.com/problems/x-of-a-kind-in-a-deck-of-cards/\u003e\n\n- [删除排序数组中的重复项](src/array/remove-duplicates-from-sorted-array.ts)\n\n  - LeetCode 26. 删除排序数组中的重复项 \u003chttps://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/\u003e\n  - LintCode 100. 删除排序数组中的重复数字 \u003chttps://www.lintcode.com/problem/remove-duplicates-from-sorted-array/description\u003e\n\n- [能否种花](src/array/can-place-flowers.ts)\n\n  - LeetCode 605. 种花问题 \u003chttps://leetcode-cn.com/problems/can-place-flowers/\u003e\n  - LintCode 1138. 能否放置花 \u003chttps://www.lintcode.com/problem/can-place-flowers/description\u003e\n\n- [循环升序数组](src/array/loop-asc-array.ts)\n\n  - 假设有一个升序数组,经过不确定长度的偏移，得到一个新的数组，我们称为循环升序数组。\n    （例如：[0, 3, 4, 6, 7] 可能变成 [6, 7, 0, 3, 4]）\n    给定一个数字和一个循环升序数组，判断这个数字是否在这个数组内，在的话返回 true，否则返回 false。要求时间复杂度为 O(logN)\n\n    示例 1：\n    输入：nums = [6, 7, 0, 3, 4]， target = 0\n    输出：true\n\n    示例 2：\n    输入：nums = [6, 7, 0, 3, 4]， target = 5\n    输出：false\n\n- [循环数组中的环](src/array/circular-array-loop.ts)\n\n  - LeetCode 457. 环形数组循环 \u003chttps://leetcode-cn.com/problems/circular-array-loop/\u003e\n  - LintCode 1229. 循环数组中的环 \u003chttps://www.lintcode.com/problem/circular-array-loop/description\u003e\n\n- [格雷编码](src/array/gray-code.ts)\n\n  - LeetCode 89. 格雷编码 \u003chttps://leetcode-cn.com/problems/gray-code/\u003e\n  - LintCode 411. 格雷编码 \u003chttps://www.lintcode.com/problem/gray-code/description\u003e\n\n- [数组划分](src/array/partition-array.ts)\n\n  - LintCode 31. 数组划分 \u003chttps://www.lintcode.com/problem/partition-array/description\u003e\n\n- [冒泡排序](src/array/bubble-sort.ts)\n\n- [选择排序](src/array/select-sort.ts)\n\n- [按奇偶排序数组](src/array/sort-array-by-parity.ts)\n\n  - LeetCode 922. 按奇偶排序数组 II \u003chttps://leetcode-cn.com/problems/sort-array-by-parity-ii/\u003e\n\n- [数组中的第 K 个最大元素](src/array/kth-largest-element-in-an-array.ts)\n\n  - LeetCode 215. 数组中的第 K 个最大元素 \u003chttps://leetcode-cn.com/problems/kth-largest-element-in-an-array/\u003e\n  - LeetCode 414. 第三大的数【相似，需去重】 \u003chttps://leetcode-cn.com/problems/third-maximum-number/submissions/\u003e\n  - LintCode 5. 第 k 大元素 \u003chttps://www.lintcode.com/problem/kth-largest-element/description\u003e\n  - LintCode 606. 第 K 大的元素 II \u003chttps://www.lintcode.com/problem/kth-largest-element-ii/description\u003e\n  - LintCode 544. 前 K 大数【相似】 \u003chttps://www.lintcode.com/problem/top-k-largest-numbers/description\u003e\n  - LintCode 479. 数组第二大数【相似】 \u003chttps://www.lintcode.com/problem/second-max-of-array/description\u003e\n\n- [最大间距](src/array/maximum-gap.ts)\n\n  - LeetCode 164. 最大间距 \u003chttps://leetcode-cn.com/problems/maximum-gap/\u003e\n  - LintCode 400. 最大间距 \u003chttps://www.lintcode.com/problem/maximum-gap/\u003e\n\n- [缺失的第一个正数](src/array/first-missing-positive.ts)\n\n  - LeetCode 41. 缺失的第一个正数 \u003chttps://leetcode-cn.com/problems/first-missing-positive/\u003e\n  - LintCode 189. 丢失的第一个正整数 \u003chttps://www.lintcode.com/problem/first-missing-positive/description\u003e\n  - LintCode 681. 缺失的第一个素数【相似】 \u003chttps://www.lintcode.com/problem/first-missing-prime-number/description\u003e\n\n- [缺失的第一个素数](src/array/first-missing-prime-number.ts)\n\n  - LintCode 681. 缺失的第一个素数 \u003chttps://www.lintcode.com/problem/first-missing-prime-number/description\u003e\n\n- [串联所有单词的子串](src/array/substring-with-concatenation-of-all-words.ts)\n\n  - LeetCode 30. 串联所有单词的子串 \u003chttps://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/\u003e\n  - LintCode 1362. 包含所有单词连接的子串 \u003chttps://www.lintcode.com/problem/substring-with-concatenation-of-all-words/description\u003e\n\n- [买卖股票的最佳时机 II](src/array/best-time-to-buy-and-sell-stock-ii.ts)\n\n  - LeetCode 122. 买卖股票的最佳时机 II \u003chttps://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/\u003e\n  - LintCode 150. 买卖股票的最佳时机 II \u003chttps://www.lintcode.com/problem/best-time-to-buy-and-sell-stock-ii/description\u003e\n\n- [搜索插入位置](src/array/search-insert-position.ts)\n\n  - LeetCode 35. 搜索插入位置 \u003chttps://leetcode-cn.com/problems/search-insert-position/\u003e\n  - LintCode 20. 搜索插入位置 \u003chttps://www.lintcode.com/problem/search-insert-position/description\u003e\n\n- [二分查找](src/array/binary-search.ts)\n\n  - LeetCode 35. 二分查找 \u003chttps://leetcode-cn.com/problems/binary-search/\u003e\n  - LintCode 20. 二分查找 \u003chttps://www.lintcode.com/problem/first-position-of-target/description\u003e\n\n- [查找常用字符](src/array/find-common-characters.ts)\n\n  - LeetCode 1002. 查找常用字符 \u003chttps://leetcode-cn.com/problems/find-common-characters/\u003e\n\n- [01 矩阵](src/array/01-matrix.ts)\n\n  - LeetCode 542. 01 矩阵 \u003chttps://leetcode-cn.com/problems/01-matrix/\u003e\n  - LintCode 974. 01 矩阵 \u003chttps://www.lintcode.com/problem/01-matrix/description\u003e\n\n- [合并区间](src/array/merge-intervals.ts)\n\n  - LeetCode 56. 合并区间 \u003chttps://leetcode-cn.com/problems/merge-intervals/\u003e\n  - LintCode 156. 合并区间 \u003chttps://www.lintcode.com/problem/merge-intervals/description\u003e\n\n- [跳跃游戏](src/array/jump-game.ts)\n\n  - LeetCode 55. 跳跃游戏 \u003chttps://leetcode-cn.com/problems/jump-game/\u003e\n  - LintCode 116. 跳跃游戏 \u003chttps://www.lintcode.com/problem/jump-game/description\u003e\n\n- [盛最多水的容器](src/array/container-with-most-water.ts)\n\n  - LeetCode 11. 盛最多水的容器 \u003chttps://leetcode-cn.com/problems/container-with-most-water/\u003e\n  - LintCode 383. 装最多水的容器 \u003chttps://www.lintcode.com/problem/container-with-most-water/description\u003e\n\n- [统计重复个数](src/array/count-the-repetitions.ts)\n\n  - LeetCode 466. 统计重复个数 \u003chttps://leetcode-cn.com/problems/count-the-repetitions/\u003e\n  - LintCode 1224. 统计重复个数 \u003chttps://www.lintcode.com/problem/count-the-repetitions/description\u003e\n\n- [岛屿的个数](src/array/number-of-islands.ts)\n\n  - LeetCode 200. 岛屿数量 \u003chttps://leetcode-cn.com/problems/number-of-islands/\u003e\n  - LintCode 433. 岛屿的个数 \u003chttps://www.lintcode.com/problem/number-of-islands/description\u003e\n\n- [统计「优美子数组」](src/array/count-number-of-nice-subarrays.ts)\n\n  - LeetCode 1248. 统计「优美子数组」 \u003chttps://leetcode-cn.com/problems/count-number-of-nice-subarrays/\u003e\n\n- [主元素](src/array/majority-element.ts)\n\n  - LeetCode 面试题 17.10. 主要元素 \u003chttps://leetcode-cn.com/problems/find-majority-element-lcci/\u003e\n  - LintCode 46. 主元素 \u003chttps://www.lintcode.com/problem/majority-element/description\u003e\n\n- [逆序对](src/array/reverse-pairs.ts)\n\n  - LeetCode 面试题 51. 数组中的逆序对 \u003chttps://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/\u003e\n  - LintCode 532. 逆序对 \u003chttps://www.lintcode.com/problem/reverse-pairs/description\u003e\n\n- [搜索旋转排序数组](src/array/search-in-rotated-sorted-array.ts)\n\n  - LeetCode 33. 搜索旋转排序数组 \u003chttps://leetcode-cn.com/problems/search-in-rotated-sorted-array/\u003e\n  - LintCode 62. 搜索旋转排序数组 \u003chttps://www.lintcode.com/problem/search-in-rotated-sorted-array/description\u003e\n\n- [数组中数字出现的次数](src/array/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof.ts)\n\n  - LeetCode 面试题 56 - I. 数组中数字出现的次数 \u003chttps://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof/\u003e\n\n- [只出现一次的数字](src/array/single-number.ts)\n\n  - LeetCode 136. 只出现一次的数字 \u003chttps://leetcode-cn.com/problems/single-number/\u003e\n\n- [山脉数组中查找目标值](src/array/find-in-mountain-array.ts)\n\n  - LeetCode 1095. 山脉数组中查找目标值 \u003chttps://leetcode-cn.com/problems/find-in-mountain-array/\u003e\n  - LeetCode 852. 山脉数组的峰顶索引 \u003chttps://leetcode-cn.com/problems/peak-index-in-a-mountain-array/\u003e\n  - LintCode 585. 山脉序列中的最大值 \u003chttps://www.lintcode.com/problem/maximum-number-in-mountain-sequence/description\u003e\n\n- [快乐数](src/array/happy-number.ts)\n\n  - LeetCode 202. 快乐数 \u003chttps://leetcode-cn.com/problems/happy-number/\u003e\n  - LintCode 488. 快乐数 \u003chttps://www.lintcode.com/problem/happy-number/description\u003e\n\n- [最大子序和](src/array/maximum-subarray.ts)\n\n  - LeetCode 53. 最大子序和 \u003chttps://leetcode-cn.com/problems/maximum-subarray/\u003e\n  - LeetCode 面试题 42. 连续子数组的最大和 \u003chttps://leetcode-cn.com/problems/lian-xu-zi-shu-zu-de-zui-da-he-lcof/\u003e\n  - LintCode 41. 最大子数组 \u003chttps://www.lintcode.com/problem/maximum-subarray/description\u003e\n\n- [跳跃游戏 II](src/array/jump-game-ii.ts)\n\n  - LeetCode 45. 跳跃游戏 II \u003chttps://leetcode-cn.com/problems/jump-game-ii/\u003e\n  - LintCode 117. 跳跃游戏 II \u003chttps://www.lintcode.com/problem/jump-game-ii/description\u003e\n\n- [最大数和最小数](src/array/maximum-and-minimum.ts)\n\n  - LintCode 770. 最大数和最小数 \u003chttps://www.lintcode.com/problem/maximum-and-minimum/description\u003e\n\n- [最低票价](src/array/minimum-cost-for-tickets.ts)\n\n  - LeetCode 983. 最低票价 \u003chttps://leetcode-cn.com/problems/minimum-cost-for-tickets/\u003e\n\n- [最大正方形](src/array/maximal-square.ts)\n\n  - LeetCode 221. 最大正方形 \u003chttps://leetcode-cn.com/problems/maximal-square/\u003e\n  - LintCode 436. 最大正方形 \u003chttps://www.lintcode.com/problem/maximal-square/description\u003e\n\n- [数据流中第一个唯一的数字](src/array/first-unique-number-in-data-stream.ts)\n\n  - LintCode 685. 数据流中第一个唯一的数字 \u003chttps://www.lintcode.com/problem/first-unique-number-in-data-stream/description\u003e\n\n- [第一个只出现一次的字符](src/array/first-unique-character-in-a-string.ts)\n\n  - LeetCode 面试题 50. 第一个只出现一次的字符 \u003chttps://leetcode-cn.com/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/\u003e\n  - LeetCode 387. 字符串中的第一个唯一字符 \u003chttps://leetcode-cn.com/problems/first-unique-character-in-a-string/\u003e\n  - LintCode 209. 第一个只出现一次的字符 \u003chttps://www.lintcode.com/problem/first-unique-character-in-a-string/description\u003e\n\n- [乘积最大子数组](src/array/maximum-product-subarray.ts)\n\n  - LeetCode 152. 乘积最大子数组 \u003chttps://leetcode-cn.com/problems/maximum-product-subarray/\u003e\n  - LintCode 191. 乘积最大子序列 \u003chttps://www.lintcode.com/problem/maximum-product-subarray/description\u003e\n\n- [最高频率的 IP](src/array/highest-frequency-ip.ts)\n\n  - LintCode 1613. 最高频率的 IP \u003chttps://www.lintcode.com/problem/highest-frequency-ip/description\u003e\n\n- [柠檬水找零](src/array/lemonade-change.ts)\n\n  - LeetCode 860. 柠檬水找零 \u003chttps://leetcode-cn.com/problems/lemonade-change/\u003e\n  - LintCode 1509. 柠檬水找零 \u003chttps://www.lintcode.com/problem/lemonade-change/description\u003e\n\n- [LRU 缓存机制](src/array/lru-cache.ts)\n\n  - LeetCode 146. LRU 缓存机制 \u003chttps://leetcode-cn.com/problems/lru-cache/\u003e\n  - LintCode 134. LRU 缓存策略 \u003chttps://www.lintcode.com/problem/lru-cache/description\u003e\n\n- [寻找重复数](src/array/find-the-duplicate-number.ts)\n\n  - LeetCode 287. 寻找重复数 \u003chttps://leetcode-cn.com/problems/find-the-duplicate-number/\u003e\n  - LintCode 633. 寻找重复的数 \u003chttps://www.lintcode.com/problem/find-the-duplicate-number/description\u003e\n\n- [和可被 K 整除的子数组](src/array/subarray-sums-divisible-by-k.ts)\n\n  - LeetCode 974. 和可被 K 整除的子数组 \u003chttps://leetcode-cn.com/problems/subarray-sums-divisible-by-k/\u003e\n\n- [打家劫舍](src/array/house-robber.ts)\n\n  - LeetCode 198. 打家劫舍 \u003chttps://leetcode-cn.com/problems/house-robber/\u003e\n  - LintCode 392. 打劫房屋 \u003chttps://www.lintcode.com/problem/house-robber/description\u003e\n\n- [拥有最多糖果的孩子](src/array/kids-with-the-greatest-number-of-candies.ts)\n\n  - LeetCode 1431. 拥有最多糖果的孩子 \u003chttps://leetcode-cn.com/problems/kids-with-the-greatest-number-of-candies/\u003e\n\n- [除自身以外数组的乘积](src/array/product-of-array-except-self.ts)\n\n  - LeetCode 238. 除自身以外数组的乘积 \u003chttps://leetcode-cn.com/problems/product-of-array-except-self/\u003e\n  - LintCode 1310. 数组除了自身的乘积 \u003chttps://www.lintcode.com/problem/product-of-array-except-self/description\u003e\n\n- [每日温度](src/array/daily-temperatures.ts)\n\n  - LeetCode 739. 每日温度 \u003chttps://leetcode-cn.com/problems/daily-temperatures/\u003e\n  - LintCode 1060. 每日温度 \u003chttps://www.lintcode.com/problem/daily-temperatures/description\u003e\n\n- [最长重复子数组](src/array/maximum-length-of-repeated-subarray.ts)\n\n  - LeetCode 718. 最长重复子数组 \u003chttps://leetcode-cn.com/problems/maximum-length-of-repeated-subarray/\u003e\n  - LintCode 79. 最长公共子串 \u003chttps://www.lintcode.com/problem/longest-common-substring/description\u003e\n\n- [有序矩阵中第 K 小的元素](src/array/kth-smallest-element-in-a-sorted-matrix.ts)\n\n  - LeetCode 378. 有序矩阵中第 K 小的元素 \u003chttps://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/\u003e\n  - LintCode 401. 排序矩阵中的从小到大第 k 个数 \u003chttps://www.lintcode.com/problem/kth-smallest-number-in-sorted-matrix/description\u003e\n\n- [黑名单中的随机数](src/array/random-pick-with-blacklist.ts)\n\n  - LeetCode 710. 黑名单中的随机数 \u003chttps://leetcode.cn/problems/random-pick-with-blacklist/\u003e\n\n- [Z 字形变换](src/array/zigzag-conversion.ts)\n\n  - LeetCode 6. Z 字形变换 \u003chttps://leetcode.cn/problems/zigzag-conversion/\u003e\n\n- [最长特殊序列 II](src/array/longest-uncommon-subsequence-ii.ts)\n\n  - LeetCode 522. 最长特殊序列 II \u003chttps://leetcode.cn/problems/longest-uncommon-subsequence-ii/\u003e\n\n- [摆动排序 II](src/array/wiggle-sort-ii.ts)\n\n  - LeetCode 324. 摆动排序 II \u003chttps://leetcode.cn/problems/wiggle-sort-ii/\u003e\n\n- [轮转数组](src/array/rotate-array.ts)\n\n  - LeetCode 189. 轮转数组 \u003chttps://leetcode.cn/problems/rotate-array/\u003e\n\n### 栈\n\n- [餐盘栈](src/stack/dinner-plate-stacks.ts)  [栈, 设计, 哈希表, 堆（优先队列）]\n\n  - LeetCode 1172. 餐盘栈 \u003chttps://leetcode.cn/problems/dinner-plate-stacks\u003e\n\n- [用栈操作构建数组](src/stack/build-an-array-with-stack-operations.ts)  [栈, 数组, 模拟]\n\n  - LeetCode 1441. 用栈操作构建数组 \u003chttps://leetcode.cn/problems/build-an-array-with-stack-operations\u003e\n\n- [简化路径](src/stack/simplify-path.ts)  [栈, 字符串]\n\n  - LeetCode 71. 简化路径 \u003chttps://leetcode.cn/problems/simplify-path/\u003e\n\n- [最大矩阵](src/stack/maximal-rectangle.ts)\n\n  - LeetCode 85. 最大矩阵 \u003chttps://leetcode-cn.com/problems/maximal-rectangle/\u003e\n  - LintCode 510. 最大矩阵 \u003chttps://www.lintcode.com/problem/maximal-rectangle/description\u003e\n\n- [最小栈](src/stack/min-stack.ts)\n\n  - LeetCode 155. 最小栈 \u003chttps://leetcode-cn.com/problems/min-stack/\u003e\n  - LintCode 12. 带最小值操作的栈 \u003chttps://www.lintcode.com/problem/min-stack/description\u003e\n\n- [用两个栈实现队列](src/stack/yong-liang-ge-zhan-shi-xian-dui-lie-lcof.ts)\n\n  - LeetCode 剑指 Offer 09. 用两个栈实现队列 \u003chttps://leetcode-cn.com/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/\u003e\n\n- [字符串解码](src/stack/decode-string.ts)\n\n  - LeetCode 394. 字符串解码 \u003chttps://leetcode-cn.com/problems/decode-string/\u003e\n  - LintCode 575. 字符串解码 \u003chttps://www.lintcode.com/problem/decode-string/description\u003e\n\n### 数学\n\n- [直线上最多的点数](src/math/max-points-on-a-line.ts)  [几何, 数组, 哈希表, 数学]\n\n  - LeetCode 149. 直线上最多的点数 \u003chttps://leetcode.cn/problems/max-points-on-a-line/\u003e\n\n- [丑数](src/math/ugly-number.ts)  [数学]\n\n  - LeetCode 263. 丑数 \u003chttps://leetcode.cn/problems/ugly-number/\u003e\n\n- [下一个更大元素 III](src/math/next-greater-element-iii.ts)  [数学, 双指针, 字符串]\n\n  - LeetCode 556. 下一个更大元素 III \u003chttps://leetcode.cn/problems/next-greater-element-iii\u003e\n\n- [阶乘后的零](src/math/factorial-trailing-zeroes.ts)\n\n  - LeetCode 172. 阶乘后的零 \u003chttps://leetcode-cn.com/problems/factorial-trailing-zeroes/submissions/\u003e\n  - LintCode 2. 尾部的零 \u003chttps://www.lintcode.com/problem/trailing-zeros/description\u003e\n\n- [丑数 II](src/math/ugly-number-ii.ts)\n\n  - LeetCode 264. 丑数 II \u003chttps://leetcode-cn.com/problems/ugly-number-ii/\u003e\n  - LintCode 4. 丑数 II \u003chttps://www.lintcode.com/problem/ugly-number-ii/description\u003e\n\n- [面试题 08.11. 硬币](src/math/coin-lcci.ts)\n\n  - LeetCode 面试题 08.11. 硬币 \u003chttps://leetcode-cn.com/problems/coin-lcci/\u003e\n\n- [全排列](src/math/permutations.ts)\n\n  - LeetCode 46. 全排列 \u003chttps://leetcode-cn.com/problems/permutations/\u003e\n  - LintCode 15. 全排列 \u003chttps://www.lintcode.com/problem/permutations/description\u003e\n\n- [最大数值](src/math/maximum-lcci.ts)\n\n  - LeetCode 面试题 16.07. 最大数值 \u003chttps://leetcode-cn.com/problems/maximum-lcci/\u003e\n\n- [回文数](src/math/palindrome-number.ts)\n\n  - LeetCode 9. 回文数 \u003chttps://leetcode-cn.com/problems/palindrome-number/\u003e\n  - LintCode 491. 回文数 \u003chttps://www.lintcode.com/problem/palindrome-number/description\u003e\n\n- [Pow(x, n)](src/math/powx-n.ts)\n\n  - LeetCode 50. Pow(x, n) \u003chttps://leetcode-cn.com/problems/powx-n/\u003e\n  - LintCode 428. x 的 n 次幂 \u003chttps://www.lintcode.com/problem/powx-n/description\u003e\n\n- [和为 K 的子数组](src/math/subarray-sum-equals-k.ts)\n\n  - LeetCode 560. 和为 K 的子数组 \u003chttps://leetcode-cn.com/problems/subarray-sum-equals-k/\u003e\n  - LintCode 838. 子数组和为 K \u003chttps://www.lintcode.com/problem/subarray-sum-equals-k/description\u003e\n\n- [完美数](src/math/perfect-number.ts)\n\n  - LeetCode 507. 完美数 \u003chttps://leetcode-cn.com/problems/perfect-number/\u003e\n  - LintCode 1199. 完美的数 \u003chttps://www.lintcode.com/problem/perfect-number/description\u003e\n\n- [寻找两个正序数组的中位数](src/math/median-of-two-sorted-arrays.ts)\n\n  - LeetCode 4. 寻找两个正序数组的中位数 \u003chttps://leetcode-cn.com/problems/median-of-two-sorted-arrays/\u003e\n  - LintCode 65. 两个排序数组的中位数 \u003chttps://www.lintcode.com/problem/median-of-two-sorted-arrays/description\u003e\n\n- [三数之和](src/math/3sum.ts)\n\n  - LeetCode 15. 三数之和 \u003chttps://leetcode-cn.com/problems/3sum/\u003e\n  - LintCode 57. 三数之和 \u003chttps://www.lintcode.com/problem/3sum/description\u003e\n\n- [二进制求和](src/math/add-binary.ts)\n\n  - LeetCode 67. 二进制求和 \u003chttps://leetcode-cn.com/problems/add-binary/\u003e\n  - LintCode 408. 二进制求和 \u003chttps://www.lintcode.com/problem/add-binary/description\u003e\n\n- [最接近的三数之和](src/math/3sum-closest.ts)\n\n  - LeetCode 16. 最接近的三数之和 \u003chttps://leetcode.cn/problems/3sum-closest/\u003e\n\n- [四数之和](src/math/4sum.ts)\n\n  - LeetCode 18. 四数之和 \u003chttps://leetcode.cn/problems/4sum/\u003e\n\n### 堆\n\n- [超级丑数](src/heap/super-ugly-number.ts) [数组, 数学, 动态规划]\n\n  - LeetCode 313. 超级丑数 \u003chttps://leetcode-cn.com/problems/super-ugly-number/\u003e\n  - LintCode 518. 超级丑数 \u003chttps://www.lintcode.com/problem/super-ugly-number/description\u003e\n\n### 树\n\n- [修剪二叉搜索树](src/tree/trim-a-binary-search-tree.ts)  [树, 深度优先搜索, 二叉搜索树, 二叉树]\n\n  - LeetCode 669. 修剪二叉搜索树 \u003chttps://leetcode.cn/problems/trim-a-binary-search-tree\u003e\n\n- [相同的树](src/tree/same-tree.ts)  [树, 深度优先搜索, 广度优先搜索, 二叉树]\n\n  - LeetCode 100. 相同的树 \u003chttps://leetcode.cn/problems/same-tree/\u003e\n\n- [我的日程安排表 I](src/tree/my-calendar-i.ts)  [设计, 线段树, 二分查找, 有序集合]\n\n  - LeetCode 729. 我的日程安排表 I \u003chttps://leetcode.cn/problems/my-calendar-i\u003e\n\n- [二叉树的右视图](src/tree/binary-tree-right-side-view.ts)\n\n  - LeetCode 199. 二叉树的右视图 \u003chttps://leetcode-cn.com/problems/binary-tree-right-side-view/\u003e\n  - LintCode 760. 二叉树的右视图 \u003chttps://www.lintcode.com/problem/binary-tree-right-side-view/description\u003e\n\n- [验证二叉搜索树](src/tree/validate-binary-search-tree.ts)\n\n  - LeetCode 98. 验证二叉搜索树 \u003chttps://leetcode-cn.com/problems/validate-binary-search-tree/\u003e\n  - LintCode 95. 验证二叉查找树 \u003chttps://www.lintcode.com/problem/validate-binary-search-tree/description\u003e\n\n- [二叉树的最近公共祖先](src/tree/lowest-common-ancestor-of-a-binary-tree.ts)\n\n  - LeetCode 236. 二叉树的最近公共祖先 \u003chttps://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/\u003e\n  - LintCode 88. 最近公共祖先 \u003chttps://www.lintcode.com/problem/lowest-common-ancestor-of-a-binary-tree/description\u003e\n\n- [另一个树的子树](src/tree/subtree-of-another-tree.ts)\n\n  - LeetCode 572. 另一个树的子树 \u003chttps://leetcode-cn.com/problems/subtree-of-another-tree/\u003e\n  - LintCode 1165. 另一个树的子树 \u003chttps://www.lintcode.com/problem/subtree-of-another-tree/description\u003e\n\n- [二叉树的层序遍历](src/tree/binary-tree-level-order-traversal.ts)\n\n  - LeetCode 102. 二叉树的层序遍历 \u003chttps://leetcode-cn.com/problems/binary-tree-level-order-traversal/\u003e\n  - LintCode 69. 二叉树的层次遍历 \u003chttps://www.lintcode.com/problem/binary-tree-level-order-traversal/description\u003e\n\n- [二叉树的层次遍历 II](src/tree/binary-tree-level-order-traversal-ii.ts)\n\n  - LeetCode 107. 二叉树的层次遍历 II \u003chttps://leetcode-cn.com/problems/binary-tree-level-order-traversal-ii/\u003e\n  - LintCode 70. 二叉树的层次遍历 II \u003chttps://www.lintcode.com/problem/binary-tree-level-order-traversal-ii/description\u003e\n\n- [从前序与中序遍历序列构造二叉树](src/tree/construct-binary-tree-from-preorder-and-inorder-traversal.ts)\n\n  - LeetCode 105. 从前序与中序遍历序列构造二叉树 \u003chttps://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/\u003e\n  - LintCode 73. 前序遍历和中序遍历树构造二叉树 \u003chttps://www.lintcode.com/problem/construct-binary-tree-from-preorder-and-inorder-traversal/description\u003e\n\n- [将有序数组转换为二叉搜索树](src/tree/convert-sorted-array-to-binary-search-tree.ts)\n\n  - LeetCode 108. 将有序数组转换为二叉搜索树 \u003chttps://leetcode-cn.com/problems/convert-sorted-array-to-binary-search-tree/\u003e\n  - LintCode 106. 有序链表转换为二叉搜索树 \u003chttps://www.lintcode.com/problem/convert-sorted-list-to-binary-search-tree/description\u003e\n\n- [不同的二叉搜索树](src/tree/unique-binary-search-trees.ts)\n\n  - LeetCode 96. 不同的二叉搜索树 \u003chttps://leetcode-cn.com/problems/unique-binary-search-trees/\u003e\n\n### 链表\n\n- [删除链表中的节点](src/list/delete-node-in-a-linked-list.ts)  [链表]\n\n  - LeetCode 237. 删除链表中的节点 \u003chttps://leetcode.cn/problems/delete-node-in-a-linked-list/\u003e\n\n- [反转链表](src/list/reverse-linked-list.ts)  [递归, 链表]\n\n  - LeetCode 206. 反转链表 \u003chttps://leetcode.cn/problems/reverse-linked-list/\u003e\n\n- [合并 K 个排序链表](src/list/merge-k-sorted-lists.ts)\n\n  - LeetCode 23. 合并 K 个排序链表 \u003chttps://leetcode-cn.com/problems/merge-k-sorted-lists/\u003e\n  - LintCode 104. 合并 k 个排序链表 \u003chttps://www.lintcode.com/problem/merge-k-sorted-lists/description\u003e\n\n- [合并两个有序链表](src/list/merge-two-sorted-lists.ts)\n\n  - LeetCode 21. 合并两个有序链表 \u003chttps://leetcode-cn.com/problems/merge-two-sorted-lists/\u003e\n  - LeetCode 面试题 25. 合并两个排序的链表 \u003chttps://leetcode-cn.com/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof\u003e\n  - LintCode 165. 合并两个排序链表 \u003chttps://www.lintcode.com/problem/merge-two-sorted-lists/description\u003e\n\n- [链表排序](src/list/sort-list.ts)\n\n  - LeetCode 148. 排序链表 \u003chttps://leetcode-cn.com/problems/sort-list/\u003e\n  - LintCode 98. 链表排序 \u003chttps://www.lintcode.com/problem/sort-list/description\u003e\n\n- [环形链表](src/list/linked-list-cycle.ts)\n\n  - LeetCode 141. 环形链表 \u003chttps://leetcode-cn.com/problems/linked-list-cycle/\u003e\n  - LintCode 102. 带环链表 \u003chttps://www.lintcode.com/problem/linked-list-cycle/description\u003e\n\n- [链表的中间结点](src/list/middle-of-the-linked-list.ts)\n\n  - LeetCode 876. 链表的中间结点 \u003chttps://leetcode-cn.com/problems/middle-of-the-linked-list/\u003e\n  - LintCode 1609. 链表的中间结点 \u003chttps://www.lintcode.com/problem/middle-of-the-linked-list/description\u003e\n\n- [K 个一组翻转链表](src/list/reverse-nodes-in-k-group.ts)\n\n  - LeetCode 25. K 个一组翻转链表 \u003chttps://leetcode-cn.com/problems/reverse-nodes-in-k-group/\u003e\n  - LintCode 450. K 组翻转链表 \u003chttps://www.lintcode.com/problem/reverse-nodes-in-k-group/description\u003e\n\n- [两两交换链表中的节点](src/list/swap-nodes-in-pairs.ts)\n\n  - LeetCode 24. 两两交换链表中的节点 \u003chttps://leetcode.cn/problems/swap-nodes-in-pairs/\u003e\n\n### 图\n\n- [最小化旅行的价格总和](src/graphs/minimize-the-total-price-of-the-trips.ts)  [树, 深度优先搜索, 图, 数组, 动态规划]\n\n  - LeetCode 2646. 最小化旅行的价格总和 \u003chttps://leetcode.cn/problems/minimize-the-total-price-of-the-trips\u003e\n\n- [可能的二分法](src/graphs/possible-bipartition.ts)  [深度优先搜索, 广度优先搜索, 并查集, 图]\n\n  - LeetCode 886. 可能的二分法 \u003chttps://leetcode.cn/problems/possible-bipartition\u003e\n\n- [找到小镇的法官](src/graphs/find-the-town-judge.ts)  [图, 数组, 哈希表]\n\n  - LeetCode 997. 找到小镇的法官 \u003chttps://leetcode.cn/problems/find-the-town-judge\u003e\n\n- [课程表](src/graphs/course-schedule-ii.ts)\n\n  - LeetCode 210. 课程表 II \u003chttps://leetcode-cn.com/problems/course-schedule-ii/\u003e\n  - LeetCode 207. 课程表 \u003chttps://leetcode-cn.com/problems/course-schedule/\u003e\n  - LintCode 615. 课程表 \u003chttps://www.lintcode.com/problem/course-schedule/description\u003e\n\n### 排序\n\n- [最小绝对差](src/sort/minimum-absolute-difference.ts)  [数组, 排序]\n\n  - LeetCode 1200. 最小绝对差 \u003chttps://leetcode.cn/problems/minimum-absolute-difference\u003e\n\n### 其它\n\n- [删除字符使频率相同](src/map/remove-letter-to-equalize-frequency.ts)  [哈希表, 字符串, 计数]\n\n  - LeetCode 2423. 删除字符使频率相同 \u003chttps://leetcode.cn/problems/remove-letter-to-equalize-frequency\u003e\n\n- [仅执行一次字符串交换能否使两个字符串相等](src/map/check-if-one-string-swap-can-make-strings-equal.ts)  [哈希表, 字符串, 计数]\n\n  - LeetCode 1790. 仅执行一次字符串交换能否使两个字符串相等 \u003chttps://leetcode.cn/problems/check-if-one-string-swap-can-make-strings-equal\u003e\n\n- [至多包含 K 个不同字符的最长子串](src/map/longest-substring-with-at-most-k-distinct-characters.ts)  [哈希表, 字符串, 滑动窗口]\n\n  - LeetCode 340. 至多包含 K 个不同字符的最长子串 \u003chttps://leetcode.cn/problems/longest-substring-with-at-most-k-distinct-characters/\u003e\n\n- [两个相同字符之间的最长子字符串](src/map/largest-substring-between-two-equal-characters.ts)  [哈希表, 字符串]\n\n  - LeetCode 1624. 两个相同字符之间的最长子字符串 \u003chttps://leetcode.cn/problems/largest-substring-between-two-equal-characters\u003e\n\n- [数组嵌套](src/search/array-nesting.ts)  [深度优先搜索, 数组]\n\n  - LeetCode 565. 数组嵌套 \u003chttps://leetcode.cn/problems/array-nesting\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyi-ge%2Ftypescript-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyi-ge%2Ftypescript-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyi-ge%2Ftypescript-practice/lists"}