2
def expressiveWords(self, s: str, words: List[str]) -> int:4
if len(s) == 0 and len(words) != 0:6
if len(words) == 0 and len(s) != 0:8
if len(s) == 0 and len(words) == 0:11
# helper function, compressing string and extract counts12
def compressor(s_word):13
init_string = [s_word[0]]16
for i, c in enumerate(s_word):17
if c == init_string[-1]:19
array.append(i - start)22
array.append(i - start + 1)23
return init_string, array26
s_split, s_array = compressor(s)30
word_split, word_array = compressor(word)31
if s_split == word_split:32
for num_s, num_word in zip(s_array, word_array):33
if num_s != num_word and num_s < 3 or num_word > num_s: