Problem :

https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/


My Solution :

class Solution:
def longestSubstring(self, s: str, k: int) -> int:
if len(s) < k:
return 0
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)