left_len = self.longestNiceSubstring(s[0:i]) # index 0 to i-1 right_len = self.longestNiceSubstring(s[i+1:len(s)+1]) # index i+1 to end Then if we see, all the characters have their lowercase and ...