滑动窗口


无重复字符的最长子串

无重复字符的最长子串

  • pre存储上一个无重复子串的第一个位置

找到字符串中所有字母异位词

找到字符串中所有字母异位词

  • i作为外循环,j每次通过i - n + 1计算
  • 每次都先更新charS,如果j < 0,continue
  • 循环结束移除charS中的j

Author: 地狱天使
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source 地狱天使 !
  TOC