<doocs>0139.Word Break_1.py
def wordBreak( s: str, wordDict: List[str]) -> bool:
    words = set(wordDict)
    n = len(s)
    dp = [False] * (n + 1)
    dp[0] = True
    for i in range(1, n + 1):
        for j in range(i):
            if dp[j] and s[j:i] in words:
                dp[i] = True
                break
    return dp[-1]
def sample_funcname ( var_0 : str , var_2 : List [ str ] ) -> bool :
    var_6 = set ( var_2 )
    var_8 = len ( var_0 )
    var_11 = [ False ] * ( var_8 + 1 )
    var_11 [ 0 ] = True
    for var_15 in range ( 1 , var_8 + 1 ) :
        for var_16 in range ( var_15 ) :
            if var_11 [ var_16 ] and var_0 [ var_16 : var_15 ] in var_6 :
                var_11 [ var_15 ] = True
                break
    return var_11 [ - 1 ]
