#include <iostream>
#include <unordered_map>
using namespace std;
class Solution {
public:
int calculateTime(string keyboard, string word) {
unordered_map<char, int> map;
for(int i = 0; i < keyboard.size(); i ++)
map[keyboard[i]] = i;
int cur = 0, res = 0;
for(char c: word)
res += abs(cur - map[c]), cur = map[c];
return res;
}
};
int main() {
return 0;
}