395 Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子串
Posted lina2014
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了395 Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子串相关的知识,希望对你有一定的参考价值。
找到给定字符串(由小写字符组成)中的最长子串 T , 要求 T 中的每一字符出现次数都不少于 k 。输出 T 的长度。
示例 1:
输入:
s = "aaabb", k = 3
输出:
3
最长子串为 "aaa" ,其中 ‘a‘ 重复了 3 次。
示例 2:
输入:
s = "ababbc", k = 2
输出:
5
最长子串为 "ababb" ,其中 ‘a‘ 重复了 2 次, ‘b‘ 重复了 3 次。
详见:https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/description/
C++:
以上是关于395 Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子串的主要内容,如果未能解决你的问题,请参考以下文章
395. Longest Substring with At Least K Repeating Characters
LeetCode 395. Longest Substring with At Least K Repeating Characters C#
leetcode395 Longest Substring with At Least K Repeating Characters
395 Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子串