comefrom: <qiyuangong>139_Word_Break_1.py
code: def wordBreak( s, wordDict):
      queue = [0]
      ls = len(s)
      lenList = [l for l in set(map(len, wordDict))]
      visited = [0 for _ in range(0, ls + 1)]
      while queue:
          start = queue.pop(0)
          for l in lenList:
              if s[start:start + l] in wordDict:
                  if start + l == ls:
                      return True
                  if visited[start + l] == 0:
                      queue.append(start + l)
                      visited[start + l] = 1
      return False
masked: def sample_funcname ( var_0 , var_1 ) :
      var_2 = [ 0 ]
      var_3 = len ( var_0 )
      var_5 = [ var_4 for var_4 in set ( map ( len , var_1 ) ) ]
      var_7 = [ 0 for var_6 in range ( 0 , var_3 + 1 ) ]
      while var_2 :
          var_8 = var_2.pop ( 0 )
          for var_4 in var_5 :
              if var_0 [ var_8 : var_8 + var_4 ] in var_1 :
                  if var_8 + var_4 == var_3 :
                      return True
                  if var_7 [ var_8 + var_4 ] == 0 :
                      var_2.append ( var_8 + var_4 )
                      var_7 [ var_8 + var_4 ] = 1
      return False
  