3. 无重复字符的最长子串bahttps://leetcode.cn/problems/longest-substring-without-repeating-characters/
| 2023-8-22
0  |  阅读时长 0 分钟
Date
Aug 22, 2023
need_review
need_review
type
undo
undo
难度
中等
给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。
示例 1:
示例 2:
示例 3:
提示:
  • 0 <= s.length <= 5 * 104
  • s 由英文字母、数字、符号和空格组成

解法1
使用字典作为临时子串索引
循环嵌套, 时间复杂度是, 空间复杂度是
notion image
解法2
滑动窗口+哈希表, 时间复杂度, 空间复杂度
notion image
解法3
  • Giscus
目录