classSolution:deflongestSubstring(self,s:str,k:int)->int:for c inset(s):if s.count(c)< k:returnmax(Solution.longestSubstring(self, t, k)for t in s.split(c))returnlen(s)
Runtime: 40 ms, faster than 31.36% of Python3 online submissions for Longest Substring with At Least K Repeating Characters.
Memory Usage: 12.8 MB, less than 100.00% of Python3 online submissions for Longest Substring with At Least K Repeating Characters.