comefrom: <doocs>0720.Longest Word in Dictionary_1.py
code: def longestWord( words: List[str]) -> str:
      cnt, ans = 0, ''
      s = set(words)
      for w in s:
          n = len(w)
          if all(w[:i] in s for i in range(1, n)):
              if cnt < n:
                  cnt, ans = n, w
              elif cnt == n and w < ans:
                  ans = w
      return ans
masked: def sample_funcname ( var_0 : List [ str ] ) -> str :
      var_1 , var_2 = 0 , ''
      var_3 = set ( var_0 )
      for var_4 in var_3 :
          var_5 = len ( var_4 )
          if all ( var_4 [ : var_6 ] in var_3 for var_6 in range ( 1 , var_5 ) ) :
              if var_1 < var_5 :
                  var_1 , var_2 = var_5 , var_4
              elif var_1 == var_5 and var_4 < var_2 :
                  var_2 = var_4
      return var_2
  