Skip to content

76. 最小覆盖子串 ​

  • 题号:76
  • 来源:LeetCode
  • 难度:困难
  • 标签:滑动窗口 哈希表 字符串
  • 语言:TypeScript · Python
  • 解法:2 个
  • 作者:lmliheng
  • 最近更新:2026-09-29

TypeScript ​

TypeScript · 更新于 2026-09-27

文件内是位运算枚举子集的代码,本题未实现

typescript
/**
 * @difficulty hard
 * @tags 滑动窗口,哈希表
 * @note 文件内是位运算枚举子集的代码,本题未实现
 * @76. 最小覆盖子串
 *
 */

let nums: number[] = [1, 2, 3]

const ans: number[][] = [];
const n: number = nums.length;
for (let mask = 0; mask < (1 << n); ++mask) { // mask二进制是01序列

    const t: number[] = [];
    for (let i = 0; i < n; ++i) {
        if (mask & (1 << i)) {
            console.log(mask, i)
            t.push(nums[i]);
        }
    }
    ans.push(t);
}


console.log(ans)

export {};

源码:ts/leetcode/76. 最小覆盖子串.ts

Python ​

Python · 更新于 2026-09-29

尚未实现,只留了题目名

python
"""
@lc 76
@title 最小覆盖子串
@difficulty hard
@tags 滑动窗口,字符串,哈希表
@note 尚未实现,只留了题目名
"""

源码:python/leetcode/hot100/12.py


在 GitHub 上查看题目所在目录:lmliheng/algorithm