2018-11-23 leetcode Longest Substring with At Least K Repeating Characters Longest Substring with At Least K Repeating CharactersSet Version - 36ms 1234567891011class Solution: def longestSubstring(self, s, k): """ :type s: str :type k: int :rtype: int """ for c in set(s): if s.count(c) < k: return max(self.longestSubstring(t, k) for t in s.split(c)) return len(s) test code 123456789In [87]: s = 'aaabb'In [88]: s.split('a')Out[88]: ['', '', '', 'bb']In [89]: k = 3In [90]: ss = Solution(); t = ss.longestSubstring(s, k); print(t)3 leet code Newer Hamming Distance Older Serialize and Deserialize Binary Tree