comefrom: <doocs>1165.Single-Row Keyboard_1.py
code: def calculateTime( keyboard: str, word: str) -> int:
      index = {c: i for i, c in enumerate(keyboard)}
      res = t = 0
      for c in word:
          res += abs(index[c] - t)
          t = index[c]
      return res
masked: def sample_funcname ( var_0 : str , var_1 : str ) -> int :
      var_4 = { var_2 : var_3 for var_3 , var_2 in enumerate ( var_0 ) }
      var_6 = var_5 = 0
      for var_2 in var_1 :
          var_6 += abs ( var_4 [ var_2 ] - var_5 )
          var_5 = var_4 [ var_2 ]
      return var_6
  