comefrom: <doocs>0336.Palindrome Pairs_1.py
code: def palindromePairs( words: List[str]) -> List[List[int]]:
      d = {w: i for i, w in enumerate(words)}
      ans = []
      for i, w in enumerate(words):
          for j in range(len(w) + 1):
              a, b = w[:j], w[j:]
              ra, rb = a[::-1], b[::-1]
              if ra in d and d[ra] != i and b == rb:
                  ans.append([i, d[ra]])
              if j and rb in d and d[rb] != i and a == ra:
                  ans.append([d[rb], i])
      return ans
masked: def sample_funcname ( var_0 : List [ str ] ) -> List [ List [ int ] ] :
      var_3 = { var_1 : var_2 for var_2 , var_1 in enumerate ( var_0 ) }
      var_4 = [ ]
      for var_2 , var_1 in enumerate ( var_0 ) :
          for var_5 in range ( len ( var_1 ) + 1 ) :
              var_6 , var_7 = var_1 [ : var_5 ] , var_1 [ var_5 : ]
              var_8 , var_9 = var_6 [ : : - 1 ] , var_7 [ : : - 1 ]
              if var_8 in var_3 and var_3 [ var_8 ] != var_2 and var_7 == var_9 :
                  var_4.append ( [ var_2 , var_3 [ var_8 ] ] )
              if var_5 and var_9 in var_3 and var_3 [ var_9 ] != var_2 and var_6 == var_8 :
                  var_4.append ( [ var_3 [ var_9 ] , var_2 ] )
      return var_4
  