parameters: (self, keyboard, word)
return_statement: return result
docstring: :type keyboard: str
          :type word: str
          :rtype: int
docstring_summary: :type keyboard: str
          :type word: str
          :rtype: int
docstring_tokens: : type keyboard : str : type word : str : rtype : int
function: def calculateTime(self, keyboard, word):
          """
          :type keyboard: str
          :type word: str
          :rtype: int
          """
          lookup = {c:i for i, c in enumerate(keyboard)}
          result, prev = 0, 0
          for c in word:
              result += abs(lookup[c]-prev)
              prev = lookup[c]
          return result
function_tokens: def calculateTime ( self , keyboard , word ) : lookup = { c : i for i , c in enumerate ( keyboard ) } result , prev = 0 , 0 for c in word : result += abs ( lookup [ c ] - prev ) prev = lookup [ c ] return result