<doocs>1813.Sentence Similarity III_1.py
def areSentencesSimilar( sentence1: str, sentence2: str) -> bool:
    if sentence1 == sentence2:
        return True
    n1, n2 = len(sentence1), len(sentence2)
    if n1 == n2:
        return False
    if n1 < n2:
        sentence1, sentence2 = sentence2, sentence1
    words1, words2 = sentence1.split(), sentence2.split()
    i = j = 0
    n1, n2 = len(words1), len(words2)
    while i < n2 and words1[i] == words2[i]:
        i += 1
    if i == n2:
        return True
    while j < n2 and words1[n1 - 1 - j] == words2[n2 - 1 - j]:
        j += 1
    return j == n2 or i + j == n2
def sample_funcname ( var_0 : str , var_2 : str ) -> bool :
    if var_0 == var_2 :
        return True
    var_6 , var_7 = len ( var_0 ) , len ( var_2 )
    if var_6 == var_7 :
        return False
    if var_6 < var_7 :
        var_0 , var_2 = var_2 , var_0
    var_10 , var_11 = var_0.split ( ) , var_2.split ( )
    var_14 = var_12 = 0
    var_6 , var_7 = len ( var_10 ) , len ( var_11 )
    while var_14 < var_7 and var_10 [ var_14 ] == var_11 [ var_14 ] :
        var_14 += 1
    if var_14 == var_7 :
        return True
    while var_12 < var_7 and var_10 [ var_6 - 1 - var_12 ] == var_11 [ var_7 - 1 - var_12 ] :
        var_12 += 1
    return var_12 == var_7 or var_14 + var_12 == var_7
