在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ Given a string s, return the maximum number of ocurrences of any substring under the following rules: The number of unique characters in the substring must be less than or equal to maxLetters. Example 1: Input: s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4 Input: s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3 Input: s = "aabcabcab", maxLetters = 2, minSize = 2, maxSize = 3 Input: s = "abcde", maxLetters = 2, minSize = 3, maxSize = 3 Constraints: 1 <= s.length <= 10^5 给你一个字符串 s ,请你返回满足以下条件且出现次数最大的 任意 子串的出现次数: 子串中不同字母的数目必须小于等于 maxLetters 。 示例 1: 输入:s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4 输入:s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3 输入:s = "aabcabcab", maxLetters = 2, minSize = 2, maxSize = 3 输入:s = "abcde", maxLetters = 2, minSize = 3, maxSize = 3 提示: 1 <= s.length <= 10^5 |
请发表评论